summaryrefslogtreecommitdiffstats
path: root/tools/binarycreator/binarycreator.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-11-04 15:45:14 +0100
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-11-05 11:31:29 +0100
commit5bacbf96beac1dd52dee7d277a15a0308a3fc98a (patch)
treeef899227f26a8df2e0242d3df43207f1e4f02582 /tools/binarycreator/binarycreator.cpp
parent26b2436b737d7b140b0ed7b9620bd128ba375b15 (diff)
Fix the steps we perform to build an installer.
We need to keep a specific order, otherwise the data might endup in the resource file as well and gets appended twice to the installer binary. Task-number: QTIFW-564 Change-Id: Idcadb5d65043d1855846556b63191898a4a54027 Reviewed-by: Christoph VogtlÃĪnder <c.vogtlaender@sigma-surface-science.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'tools/binarycreator/binarycreator.cpp')
-rw-r--r--tools/binarycreator/binarycreator.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp
index 04f1f0535..bb73eb5c6 100644
--- a/tools/binarycreator/binarycreator.cpp
+++ b/tools/binarycreator/binarycreator.cpp
@@ -699,12 +699,20 @@ int main(int argc, char **argv)
tmp.setAutoRemove(false);
const QString tmpMetaDir = tmp.path();
try {
- const Settings settings = Settings::fromFileAndPrefix(configFile, QFileInfo(configFile).absolutePath());
- QInstallerTools::PackageInfoVector packages = QInstallerTools::createListOfPackages(packagesDirectories,
- &filteredPackages, ftype);
- QInstallerTools::copyMetaData(tmpMetaDir, packagesDirectories.first(), packages, settings.applicationName(),
- settings.applicationVersion());
+ const Settings settings = Settings::fromFileAndPrefix(configFile, QFileInfo(configFile)
+ .absolutePath());
+ // Note: there order here is important if we build offline only installers
+
+ // 1; create the list of available packages
+ QInstallerTools::PackageInfoVector packages =
+ QInstallerTools::createListOfPackages(packagesDirectories, &filteredPackages, ftype);
+
+ // 2; copy the meta data of the available packages
+ QInstallerTools::copyMetaData(tmpMetaDir, packagesDirectories.first(), packages, settings
+ .applicationName(), settings.applicationVersion());
+
+ // 3; copy the configuration file and and icons etc.
copyConfigData(configFile, tmpMetaDir + QLatin1String("/installer-config"));
{
QSettings confInternal(tmpMetaDir + QLatin1String("/config/config-internal.ini")
@@ -720,18 +728,20 @@ int main(int argc, char **argv)
target += QLatin1String(".app");
#endif
if (!compileResource) {
- QInstallerTools::copyComponentData(packagesDirectories, tmpMetaDir, &packages);
-
- input.packages = packages;
- input.outputPath = target;
- input.installerExePath = templateBinary;
-
+ // 4; put the copied resources into a resource file
QInstaller::ResourceCollection metaCollection("QResources");
metaCollection.appendResource(createDefaultResourceFile(tmpMetaDir,
generateTemporaryFileName()));
metaCollection.appendResources(createBinaryResourceFiles(resources));
input.manager.insertCollection(metaCollection);
+ // 5; copy the packages data and setup the packages vector with the files we copied
+ QInstallerTools::copyComponentData(packagesDirectories, tmpMetaDir, &packages);
+
+ input.packages = packages;
+ input.outputPath = target;
+ input.installerExePath = templateBinary;
+
qDebug() << "Creating the binary";
exitCode = assemble(input, settings);
} else {