summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore_p.cpp
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-08-03 15:41:53 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-08-16 12:48:31 +0300
commit72c6dc7bd1cb53c99ac1ca79e1a242ae6ba7d619 (patch)
tree6892bb1eee7c0d9191503b8f4f84d1dd4e671fc4 /src/libs/installer/packagemanagercore_p.cpp
parent2389c5138d99a6ac0caea0f13d2d40f8b5cbc7d3 (diff)
MT: Fix reading of StartMenuDir value from incorrect config file
Value of StartMenuDir variable should be permanent after initial installation and must be read from maintenancetool.ini, don't use the default value from internal configuration file (metadata/installer- config/config.xml) of the maintenance tool binary as it: - Does not contain the path prefix for either user or system-wide start menu directory, we add this later depending on the installation type. - May change altogether with a new configuration file if the vendor has provided an update mechanism for maintenance tool, or if the user has opted for a non-default location. Task-number: QTIFW-2284 Change-Id: Id731d151b9f0acc77aa146722d1e088ea6a47eb3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagercore_p.cpp')
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 24a67d095..270cd7760 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -920,8 +920,13 @@ void PackageManagerCorePrivate::readMaintenanceConfigFiles(const QString &target
const QVariantHash v = cfg.value(QLatin1String("Variables")).toHash(); // Do not change to
// QVariantMap! Breaks reading from existing .ini files, cause the variant types do not match.
for (QVariantHash::const_iterator it = v.constBegin(); it != v.constEnd(); ++it) {
- if (!m_data.contains(it.key()) || m_data.value(it.key()).isNull())
- m_data.setValue(it.key(), replacePath(it.value().toString(), QLatin1String(scRelocatable), targetDir));
+ if (m_data.contains(it.key()) && !m_data.value(it.key()).isNull()) {
+ // Exception: StartMenuDir should be permanent after initial installation
+ // and must be read from maintenancetool.ini
+ if (it.key() != scStartMenuDir)
+ continue;
+ }
+ m_data.setValue(it.key(), replacePath(it.value().toString(), QLatin1String(scRelocatable), targetDir));
}
QSet<Repository> repos;
const QVariantList variants = cfg.value(QLatin1String("DefaultRepositories"))