mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-20 07:58:44 +00:00
Changed: Only enable migration under Windows when launched from 2.1 client directory
This commit is contained in:
parent
1b37624679
commit
88a87a07a0
4 changed files with 9 additions and 77 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue