diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-08-19 13:34:00 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-08-20 08:59:41 +0000 |
commit | a81f19295745d081306f9417d6c45fda252fcb89 (patch) | |
tree | b9c9f03c2ed42cae5cb9ee22306420e4ea817590 /src/libs/installer/packagemanagercore_p.cpp | |
parent | 85ce2334cf8ddc4a44037a70e29551d51759ef4e (diff) |
Fix errors when running updates in a directory requiring elevation
isWritable() is not a reliable way to check for permissions on Windows.
Instead, just try to create a file.
The alternative would be to set the magic qt_ntfs_permission_lookup
variable to 1. Anyhow, this might slow down things and cause other
regressions ...
Task-number: QTIFW-746
Change-Id: I1b5637670bfcfe29966f0545ce2c6b1f663a9738
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/packagemanagercore_p.cpp')
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index 7d2864cfb..542d51603 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -1604,9 +1604,8 @@ bool PackageManagerCorePrivate::runPackageUpdater() //to have some progress for the cleanup/write component.xml step ProgressCoordinator::instance()->addReservePercentagePoints(1); - const QString packagesXml = componentsXmlPath(); // check if we need admin rights and ask before the action happens - if (!QFileInfo(installerBinaryPath()).isWritable() || !QFileInfo(packagesXml).isWritable()) + if (!QTemporaryFile(targetDir() + QStringLiteral("/XXXXXX")).open()) adminRightsGained = m_core->gainAdminRights(); const QList<Component *> componentsToInstall = m_core->orderedComponentsToInstall(); |