summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-08-19 13:34:00 +0200
committerKai Koehne <kai.koehne@theqtcompany.com>2015-08-20 08:59:41 +0000
commita81f19295745d081306f9417d6c45fda252fcb89 (patch)
treeb9c9f03c2ed42cae5cb9ee22306420e4ea817590
parent85ce2334cf8ddc4a44037a70e29551d51759ef4e (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>
-rw-r--r--Changelog1
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp3
2 files changed, 2 insertions, 2 deletions
diff --git a/Changelog b/Changelog
index 4eef4bccd..a7a823618 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@
- Fix handling of system proxy with credentials. (QTBUG-46547)
- Unify selection of language for translations. (QTIFW-390)
- Fix return value of component.installAction() when updating. (QTIFW-727)
+- Fix errors when updating an installation requiring elevation on Windows. (QTIFW-746)
- Documentation updates.
2.0.1
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();