From 444bdeceb6839f39ae22afb3ffe5b4bfe6709906 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 25 Jul 2016 18:54:37 +0200 Subject: [PATCH] Changed: Check default installer.ini in different places, see #279 --- .../client/ryzom_installer/src/configfile.cpp | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 7b5f14fcf..63980e5fe 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -144,8 +144,25 @@ CConfigFile::CConfigFile(QObject *parent):QObject(parent), m_defaultServerIndex( { s_instance = this; - m_language = QLocale::system().name().left(2); // only keep language ISO 639 code - m_defaultConfigPath = QApplication::applicationDirPath() + "/installer.ini"; + // only keep language ISO 639 code + m_language = QLocale::system().name().left(2); + + // it won't be found if run with uninstall flag, but since we already have a local installer.ini... + QString configFile = getCurrentDirectory() + "/installer.ini"; + + if (!QFile::exists(configFile)) + { + configFile = QApplication::applicationDirPath() + "/installer.ini"; + + if (!QFile::exists(configFile)) + { + configFile.clear(); + } + } + + m_defaultConfigPath = configFile; + + // the config file we'll write m_configPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/installer.ini"; }