From d2bc930ea32622f409964ad66f5365cb075fc165 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 18 Oct 2016 10:26:41 +0200 Subject: [PATCH] Fixed: Special case under Windows when Installer is run from TEMP directory --- .../client/ryzom_installer/src/configfile.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index a069331f3..babad9397 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -983,7 +983,19 @@ OperationStep CConfigFile::getInstallNextStep() const case -1: return LaunchInstalledInstaller; // continue only if 0 and launched Installer is the installed one - default: if (getInstallerCurrentFilePath() != getInstallerInstalledFilePath() && QFile::exists(getInstallerInstalledFilePath())) return LaunchInstalledInstaller; + default: + { +#ifdef Q_OS_WIN32 + QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation); + + // check if launched from TEMP directory + bool rightPath = getInstallerCurrentDirPath().startsWith(tempPath); +#else + bool rightPath = false; +#endif + + if (!rightPath && getInstallerCurrentFilePath() != getInstallerInstalledFilePath() && QFile::exists(getInstallerInstalledFilePath())) return LaunchInstalledInstaller; + } } // no default profile