From a81f19295745d081306f9417d6c45fda252fcb89 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 19 Aug 2015 13:34:00 +0200 Subject: 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 Reviewed-by: Karsten Heimrich --- src/libs/installer/packagemanagercore_p.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libs') 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 componentsToInstall = m_core->orderedComponentsToInstall(); -- cgit v1.2.3