diff options
author | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-06-11 16:40:08 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-06-11 15:41:21 +0000 |
commit | 99c2eb19c3e9b5d7a731edec28a74e451efe3278 (patch) | |
tree | aaade61ee009d32d6f972ec2d0a966b466700425 /src | |
parent | 09b8632d301ffa865bf717c5497b6b7a17e86b53 (diff) |
Fix: .dat file gets deleted after multiple component changes.
We can close the .dat file in maintenance mode. There is no need
to keep it open since no packages are in there and resources are
mapped into memory anyway. Fixes commit 7f2c98c8 that updates the
.dat file on soft restart. On Windows updating did not work cause
the .dat is opened and locked by the OS. To overcome locked files
we run a VB script that does a deferred rename once the lock is
gone, but in case of a soft restart we now did start several of
them depending on the amount of restarts.
That had the undesired effect of several replace/rename operations,
of which only 2 "succeeded":
- First script: Remove .dat | Rename .dat.new -> .dat
- Second script: Remove .dat | no .dat anymore...
Task-number: QTIFW-689
Change-Id: Ic3ee1b418890eabe5b854dc7879cd7bc118f9240
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/sdk/installerbase.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 343a0a1ca..23d579de3 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -107,6 +107,12 @@ int InstallerBase::run() QInstaller::BinaryContent::readBinaryContent(&binary, &oldOperations, &manager, &magicMarker, cookie); + // Usually resources simply get mapped into memory and therefore the file does not need to be + // kept open during application runtime. Though in case of offline installers we need to access + // the appended binary content (packages etc.), so we close only in maintenance mode. + if (magicMarker != QInstaller::BinaryContent::MagicInstallerMarker) + binary.close(); + CommandLineParser parser; parser.parse(arguments()); |