From 43b658e815858ea8326814dc15db2533eae55565 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 26 May 2016 19:32:21 +0200 Subject: [PATCH] Changed: Return language selected in old installer --HG-- branch : develop --- .../client/ryzom_installer/src/configfile.cpp | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index f305c7395..5fedf1426 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -413,7 +413,6 @@ QString CConfigFile::getOldInstallationDirectory() QString CConfigFile::getOldInstallationLanguage() { - // HKEY_CURRENT_USER/SOFTWARE/Nevrax/RyzomInstall/InstallId=1917716796 (string) #if defined(Q_OS_WIN) // NSIS previous official installer #ifdef Q_OS_WIN64 @@ -426,23 +425,21 @@ QString CConfigFile::getOldInstallationLanguage() if (settings.contains("Language")) { QString languageCode = settings.value("Language").toString(); - // 1036 = French - return ""; - } - return "en"; -#elif defined(Q_OS_MAC) - return "/Applications/Ryzom.app"; -#else - return QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.ryzom"; + // 1036 = French (France), 1033 = English (USA), 1031 = German + if (languageCode == "1036") return "fr"; + if (languageCode == "1031") return "de"; + if (languageCode == "1033") return "en"; + } #endif + + return ""; } QString CConfigFile::getNewInstallationLanguage() { - // HKEY_CURRENT_USER/SOFTWARE/Nevrax/RyzomInstall/InstallId=1917716796 (string) #if defined(Q_OS_WIN) - // NSIS previous official installer + // NSIS new official installer #ifdef Q_OS_WIN64 // use WOW6432Node in 64 bits (64 bits OS and 64 bits Installer) because Ryzom old installer was in 32 bits QSettings settings("HKEY_LOCAL_MACHINE\\Software\\WOW6432Node\\Nevrax\\Ryzom", QSettings::NativeFormat); @@ -454,14 +451,9 @@ QString CConfigFile::getNewInstallationLanguage() { return QDir::fromNativeSeparators(settings.value("Ryzom Install Path").toString()); } - - // check default directory if registry key not found - return CConfigFile::has64bitsOS() ? "C:/Program Files (x86)/Ryzom" : "C:/Program Files/Ryzom"; -#elif defined(Q_OS_MAC) - return "/Applications/Ryzom.app"; -#else - return QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.ryzom"; #endif + + return ""; } QString CConfigFile::getNewInstallationDirectory()