From 88a87a07a0f68d16eccaaf361570d7deba2b044d Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 21 Oct 2016 12:53:10 +0200 Subject: [PATCH] Changed: Only enable migration under Windows when launched from 2.1 client directory --- .../client/ryzom_installer/src/configfile.cpp | 53 ------------------- .../client/ryzom_installer/src/configfile.h | 2 - .../ryzom_installer/src/migratedialog.cpp | 27 ++-------- .../ryzom_installer/src/migratedialog.h | 4 ++ 4 files changed, 9 insertions(+), 77 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index bf3c64cb2..c6b7a577d 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -505,59 +505,6 @@ QString CConfigFile::getParentDirectory() return current.absolutePath(); } -QString CConfigFile::getOldInstallationDirectory() -{ - // HKEY_CURRENT_USER/SOFTWARE/Nevrax/RyzomInstall/InstallId=1917716796 (string) -#if defined(Q_OS_WIN) - // NSIS previous 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); -#else - QSettings settings("HKEY_LOCAL_MACHINE\\Software\\Nevrax\\Ryzom", QSettings::NativeFormat); -#endif - - if (settings.contains("Ryzom Install Path")) - { - 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 -} - -QString CConfigFile::getOldInstallationLanguage() -{ -#if defined(Q_OS_WIN) - // NSIS previous 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); -#else - QSettings settings("HKEY_LOCAL_MACHINE\\Software\\Nevrax\\Ryzom", QSettings::NativeFormat); -#endif - - QString key = "Language"; - - if (settings.contains(key)) - { - QString languageCode = settings.value(key).toString(); - - // 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() { #if defined(Q_OS_WIN) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index 1f71ad56b..d1560c40e 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -90,9 +90,7 @@ public: // default directories static QString getCurrentDirectory(); static QString getParentDirectory(); - static QString getOldInstallationDirectory(); static QString getNewInstallationDirectory(); - static QString getOldInstallationLanguage(); static QString getNewInstallationLanguage(); // status of installation diff --git a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp index 0aec91d09..6c9f6f1e5 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp @@ -16,6 +16,9 @@ #include "stdpch.h" #include "migratedialog.h" + +#ifdef Q_OS_WIN32 + #include "configfile.h" #include "utils.h" @@ -49,12 +52,6 @@ CMigrateDialog::CMigrateDialog():QDialog() // update default destination onDestinationDefaultButtonClicked(); -#ifdef Q_OS_MAC - // only 64 bits for OS X - clientArchGroupBox->setVisible(false); - clientArch64RadioButton->setChecked(true); - clientArch32RadioButton->setChecked(false); -#elif defined(Q_OS_WIN32) // both 32 and 64 bits are working under Windows 64 bits // check whether OS architecture is 32 or 64 bits @@ -72,22 +69,6 @@ CMigrateDialog::CMigrateDialog():QDialog() clientArch64RadioButton->setChecked(false); clientArch32RadioButton->setChecked(true); } -#else - // only use the current architecture for Linux - - clientArchGroupBox->setVisible(false); - -#ifdef _LP64 - // only 64 bits is available - clientArch64RadioButton->setChecked(true); - clientArch32RadioButton->setChecked(false); -#else - // only 32 bits is available - clientArch64RadioButton->setChecked(false); - clientArch32RadioButton->setChecked(true); -#endif - -#endif const CServer &server = CConfigFile::getInstance()->getServer(); @@ -198,3 +179,5 @@ void CMigrateDialog::accept() QDialog::accept(); } + +#endif diff --git a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.h b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.h index 9cd584372..3c19bc6f4 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.h @@ -17,6 +17,8 @@ #ifndef MIGRATEDIALOG_H #define MIGRATEDIALOG_H +#if defined(Q_OS_WIN32) || defined(Q_MOC_RUN) + #include "ui_migratedialog.h" /** @@ -48,3 +50,5 @@ private: }; #endif + +#endif