Changed: Only enable migration under Windows when launched from 2.1 client directory

This commit is contained in:
kervala 2016-10-21 12:53:10 +02:00
parent 1b37624679
commit 88a87a07a0
4 changed files with 9 additions and 77 deletions

View file

@ -505,59 +505,6 @@ QString CConfigFile::getParentDirectory()
return current.absolutePath(); 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() QString CConfigFile::getNewInstallationLanguage()
{ {
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)

View file

@ -90,9 +90,7 @@ public:
// default directories // default directories
static QString getCurrentDirectory(); static QString getCurrentDirectory();
static QString getParentDirectory(); static QString getParentDirectory();
static QString getOldInstallationDirectory();
static QString getNewInstallationDirectory(); static QString getNewInstallationDirectory();
static QString getOldInstallationLanguage();
static QString getNewInstallationLanguage(); static QString getNewInstallationLanguage();
// status of installation // status of installation

View file

@ -16,6 +16,9 @@
#include "stdpch.h" #include "stdpch.h"
#include "migratedialog.h" #include "migratedialog.h"
#ifdef Q_OS_WIN32
#include "configfile.h" #include "configfile.h"
#include "utils.h" #include "utils.h"
@ -49,12 +52,6 @@ CMigrateDialog::CMigrateDialog():QDialog()
// update default destination // update default destination
onDestinationDefaultButtonClicked(); 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 // both 32 and 64 bits are working under Windows 64 bits
// check whether OS architecture is 32 or 64 bits // check whether OS architecture is 32 or 64 bits
@ -72,22 +69,6 @@ CMigrateDialog::CMigrateDialog():QDialog()
clientArch64RadioButton->setChecked(false); clientArch64RadioButton->setChecked(false);
clientArch32RadioButton->setChecked(true); 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(); const CServer &server = CConfigFile::getInstance()->getServer();
@ -198,3 +179,5 @@ void CMigrateDialog::accept()
QDialog::accept(); QDialog::accept();
} }
#endif

View file

@ -17,6 +17,8 @@
#ifndef MIGRATEDIALOG_H #ifndef MIGRATEDIALOG_H
#define MIGRATEDIALOG_H #define MIGRATEDIALOG_H
#if defined(Q_OS_WIN32) || defined(Q_MOC_RUN)
#include "ui_migratedialog.h" #include "ui_migratedialog.h"
/** /**
@ -48,3 +50,5 @@ private:
}; };
#endif #endif
#endif