From 1c606692fcf95b83296eb3174874ce9425771e18 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 26 May 2016 19:34:15 +0200 Subject: [PATCH] Changed: New step for add/remove program --HG-- branch : develop --- .../client/ryzom_installer/src/configfile.cpp | 7 +++++ .../client/ryzom_installer/src/configfile.h | 1 + .../ryzom_installer/src/operationdialog.cpp | 28 +++++-------------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 2ade8809c..b855e7905 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -712,5 +712,12 @@ CConfigFile::InstallationStep CConfigFile::getNextStep() const return CreateShortcuts; } +#ifdef Q_OS_WIN + // check that Add/Remove entry is created under Windows + QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat); + + if (!settings.contains("InstallLocation")) return CreateAddRemoveEntry; +#endif + return Done; } diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index d65c8aae7..72325667b 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -95,6 +95,7 @@ public: CopyInstaller, CreateProfile, CreateShortcuts, + CreateAddRemoveEntry, Done }; diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 5368c02db..e614b4452 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -152,6 +152,10 @@ void COperationDialog::processNextStep() createDefaultShortcuts(); break; + case CConfigFile::CreateAddRemoveEntry: + createAddRemoveEntry(); + break; + case CConfigFile::Done: accept(); break; @@ -503,8 +507,6 @@ bool COperationDialog::createDefaultProfile() config->addProfile(profile); config->save(); - createAddRemoveEntry(); - emit done(); return true; @@ -519,12 +521,8 @@ bool COperationDialog::createDefaultShortcuts() bool COperationDialog::createAddRemoveEntry() { - QString ff = QApplication::applicationFilePath(); - CConfigFile *config = CConfigFile::getInstance(); - CFilesCopier copier(this); - const CServer &server = config->getServer(); QString oldInstallerFilename = server.clientFilenameOld; @@ -535,22 +533,9 @@ bool COperationDialog::createAddRemoveEntry() QString oldInstallerFullPath = config->getSrcServerDirectory() + "/" + oldInstallerFilename; QString newInstallerFullPath = config->getInstallationDirectory() + "/" + newInstallerFilename; - if (QFile::exists(oldInstallerFullPath) && !QFile::exists(newInstallerFullPath)) - { - QStringList filter; - filter << oldInstallerFilename; - filter << "msvcp100.dll"; - filter << "msvcr100.dll"; - - copier.setIncludeFilter(filter); - copier.setDesinationDirectory(config->getInstallationDirectory()); - copier.exec(); - - QFile::rename(oldInstallerFullPath, newInstallerFullPath); - } - if (QFile::exists(newInstallerFullPath)) { +#ifdef Q_OS_WIN QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat); QStringList versionTokens = QString(RYZOM_VERSION).split('.'); @@ -575,10 +560,11 @@ bool COperationDialog::createAddRemoveEntry() // settings.setValue("sEstimatedSize2", 0); settings.setValue("HelpLink", "http://ryzom.fr/support"); // ModifyPath +#endif } } -// emit done(); + emit done(); return true; }