diff options
author | Katja Marttila <katja.marttila@theqtcompany.com> | 2016-05-05 15:18:34 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2016-06-21 04:51:29 +0000 |
commit | 76fd6e8f2953347ea0bf7a57b643968784bc9acc (patch) | |
tree | adc2ed4e61b4778c8995de6760bf514b8e3b3d37 /tools/binarycreator/binarycreator.cpp | |
parent | e28bd0a98dd1a7ca0846cd406b23c6e5429ac82d (diff) |
Allow signing maintenancetool in Windows
Signing was not possible for maintenancetool since metadata was
added to binary. Separated metadata to installer.dat like in OS X.
Task-number: QTIFW-667
Change-Id: I74ef307c51a2f43059475dd943d6f0910925fa86
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'tools/binarycreator/binarycreator.cpp')
-rw-r--r-- | tools/binarycreator/binarycreator.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp index 1a6a10471..23261211d 100644 --- a/tools/binarycreator/binarycreator.cpp +++ b/tools/binarycreator/binarycreator.cpp @@ -241,10 +241,12 @@ static int assemble(Input input, const QInstaller::Settings &settings, const QSt QTemporaryFile out; QString targetName = input.outputPath; -#ifdef Q_OS_OSX +#if defined Q_OS_OSX || defined Q_OS_WIN QDir resourcePath(QFileInfo(input.outputPath).dir()); +#ifdef Q_OS_OSX resourcePath.cdUp(); resourcePath.cd(QLatin1String("Resources")); +#endif targetName = resourcePath.filePath(QLatin1String("installer.dat")); #endif @@ -262,7 +264,10 @@ static int assemble(Input input, const QInstaller::Settings &settings, const QSt QInstaller::openForWrite(&out); QFile exe(input.installerExePath); -#ifdef Q_OS_OSX +#if defined Q_OS_OSX || defined Q_OS_WIN + // remove the target + if (QFile::exists(input.outputPath)) + QFile::remove(input.outputPath); if (!exe.copy(input.outputPath)) { throw Error(QString::fromLatin1("Cannot copy %1 to %2: %3").arg(exe.fileName(), input.outputPath, exe.errorString())); |