diff options
author | Frerich Raabe <raabe@froglogic.com> | 2016-06-02 11:40:47 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2016-06-15 08:54:46 +0000 |
commit | b4a1a89e306367feaec56ce9902d15234ece5f84 (patch) | |
tree | 5807e51d2b77c4df676136444726f2a003bd3c6a /src/sdk/updatechecker.cpp | |
parent | f11fce311bb954457da1641ccbc6684e7cdd3418 (diff) |
Store lock files in temporary directory
The directory in which the application is stored may not be writable for
the current user, e.g. if the installer is stored on a read-only network
drive, or (common case on OS X) if the installer bundle is started from
a read-only .dmg image.
This fixes warnings in the verbose output (especially noticeable during
unattended installations) like:
[0] Warning: Cannot create lock file "/Volumes/froglogic Squish/Install Squish.app/Contents/MacOS/Squish1234865.lock": Read-only file system
The patch is defensive in that it just uses QDir::tempPath() instead of
going for QTemporaryFile to avoid having to worry about auto-delete
semantics.
Change-Id: Iee2409dd6f884c4fe234057b2926eee82127f985
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/sdk/updatechecker.cpp')
-rw-r--r-- | src/sdk/updatechecker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sdk/updatechecker.cpp b/src/sdk/updatechecker.cpp index 1276ea436..823c94c27 100644 --- a/src/sdk/updatechecker.cpp +++ b/src/sdk/updatechecker.cpp @@ -41,6 +41,7 @@ #include <packagemanagercore.h> #include <productkeycheck.h> +#include <QDir> #include <QDomDocument> #include <iostream> @@ -53,7 +54,7 @@ UpdateChecker::UpdateChecker(int &argc, char *argv[]) int UpdateChecker::check() { - RunOnceChecker runCheck(qApp->applicationDirPath() + RunOnceChecker runCheck(QDir::tempPath() + QLatin1Char('/') + qApp->applicationName() + QLatin1String("15021976.lock")); |