summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore_p.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2016-09-14 13:15:05 +0000
committerKatja Marttila <katja.marttila@qt.io>2016-09-15 07:01:05 +0000
commit49201fdb99ee6ca7f6bee296f51f5036345017c6 (patch)
tree392f84e474b15eb60faf477cec226571b4ad728e /src/libs/installer/packagemanagercore_p.cpp
parentfc0b26f4d202776456ceca1be4206739a8be9247 (diff)
Revert "Allow signing maintenancetool in Windows"
This reverts commit 76fd6e8f2953347ea0bf7a57b643968784bc9acc. The change caused that two installation files were needed - one executable and one dat file. Many users did not find it acceptable. We need to figure out something else. Change-Id: Ief12cd47f9897cee8a234d8611a5c18296d42b1c Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagercore_p.cpp')
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 019bbfe78..b972545ce 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -995,14 +995,12 @@ void PackageManagerCorePrivate::writeMaintenanceToolBinary(QFile *const input, q
QInstaller::appendData(&out, input, size);
if (writeBinaryLayout) {
-#if defined Q_OS_OSX || defined Q_OS_WIN
- QDir resourcePath(QFileInfo(maintenanceToolRenamedName).dir());
#ifdef Q_OS_OSX
+ QDir resourcePath(QFileInfo(maintenanceToolRenamedName).dir());
if (!resourcePath.path().endsWith(QLatin1String("Contents/MacOS")))
throw Error(tr("Maintenance tool is not a bundle"));
resourcePath.cdUp();
resourcePath.cd(QLatin1String("Resources"));
-#endif
// It's a bit odd to have only the magic in the data file, but this simplifies
// other code a lot (since installers don't have any appended data either)
QTemporaryFile dataOut;
@@ -1029,7 +1027,7 @@ void PackageManagerCorePrivate::writeMaintenanceToolBinary(QFile *const input, q
dataOut.setAutoRemove(false);
dataOut.setPermissions(dataOut.permissions() | QFile::WriteUser | QFile::ReadGroup
| QFile::ReadOther);
-#elif defined(Q_OS_LINUX)
+#else
QInstaller::appendInt64(&out, 0); // operations start
QInstaller::appendInt64(&out, 0); // operations end
QInstaller::appendInt64(&out, 0); // resource count
@@ -1298,15 +1296,12 @@ void PackageManagerCorePrivate::writeMaintenanceTool(OperationList performedOper
QInstaller::openForRead(&input);
layout = BinaryContent::binaryLayout(&input, BinaryContent::MagicCookieDat);
} catch (const Error &/*error*/) {
-#if defined Q_OS_OSX || defined Q_OS_WIN
- // On Mac and Windows data is always in a separate file
- // so that the binary can be signed
+#ifdef Q_OS_OSX
+ // On Mac, data is always in a separate file so that the binary can be signed
QString binaryName = isInstaller() ? installerBinaryPath() : maintenanceToolName();
QDir dataPath(QFileInfo(binaryName).dir());
-#ifdef Q_OS_OSX
dataPath.cdUp();
dataPath.cd(QLatin1String("Resources"));
-#endif
input.setFileName(dataPath.filePath(QLatin1String("installer.dat")));
QInstaller::openForRead(&input);