diff options
author | Christoph VogtlÃĪnder <c.vogtlaender@sigma-surface-science.com> | 2014-11-18 12:46:01 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2014-11-18 16:34:49 +0100 |
commit | de66578f229c7f6b2682d7429e4a76dd57cd0ce3 (patch) | |
tree | 997a10b2f8827262618d24b46e213fcb0a892b52 /tools | |
parent | 4f0db0751bea01cefff87cdedb9a0ba8fa40e083 (diff) |
Fix generation of Updates.xml
Generated Updates.xml was missing DownloadableArchives property and
component size was not calculated properly in case package directory
contains files that are packaged into 7zip archives by the installer.
Change-Id: I73e3d16b73cfbe25cb8b2e55b9c93f48b1ecdb1c
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/binarycreator/binarycreator.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp index cee78c348..7f5ef0eb1 100644 --- a/tools/binarycreator/binarycreator.cpp +++ b/tools/binarycreator/binarycreator.cpp @@ -693,21 +693,29 @@ int main(int argc, char **argv) QTemporaryDir tmp; tmp.setAutoRemove(false); const QString tmpMetaDir = tmp.path(); + QTemporaryDir tmp2; + tmp2.setAutoRemove(false); + const QString tmpRepoDir = tmp2.path(); try { const Settings settings = Settings::fromFileAndPrefix(configFile, QFileInfo(configFile) .absolutePath()); - // Note: there order here is important if we build offline only installers + // Note: the order here is important // 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 + // 2; copy the packages data and setup the packages vector with the files we copied, + // must happen before copying meta data because files will be compressed if + // needed and meta data generation relies on this + QInstallerTools::copyComponentData(packagesDirectories, tmpRepoDir, &packages); + + // 3; copy the meta data of the available packages, generate Updates.xml + QInstallerTools::copyMetaData(tmpMetaDir, tmpRepoDir, packages, settings .applicationName(), settings.applicationVersion()); - // 3; copy the configuration file and and icons etc. + // 4; copy the configuration file and and icons etc. copyConfigData(configFile, tmpMetaDir + QLatin1String("/installer-config")); { QSettings confInternal(tmpMetaDir + QLatin1String("/config/config-internal.ini") @@ -723,16 +731,13 @@ int main(int argc, char **argv) target += QLatin1String(".app"); #endif if (!compileResource) { - // 4; put the copied resources into a resource file + // 5; 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; @@ -756,6 +761,7 @@ int main(int argc, char **argv) foreach (const QSharedPointer<QInstaller::Resource> &resource, collection.resources()) QFile::remove(QString::fromUtf8(resource->name())); QInstaller::removeDirectory(tmpMetaDir, true); + QInstaller::removeDirectory(tmpRepoDir, true); return exitCode; } |