From 130b2c3c1a3280cc2e986cd7499058cf4790cbb2 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 25 May 2016 23:28:42 +0200 Subject: [PATCH] Changed: More variables in INI file --HG-- branch : develop --- .../client/ryzom_installer/src/configfile.cpp | 31 ++++++++++++++++--- .../client/ryzom_installer/src/configfile.h | 4 +++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 50d0cdc97..3028ba7b6 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -83,13 +83,19 @@ bool CConfigFile::load(const QString &filename) server.clientDownloadFilename = settings.value("client_download_filename").toString(); #if defined(Q_OS_WIN) server.clientFilename = settings.value("client_filename_windows").toString(); + server.clientFilenameOld = settings.value("client_filename_old_windows").toString(); server.configurationFilename = settings.value("configuration_filename_windows").toString(); + server.installerFilename = settings.value("installer_filename_windows").toString(); #elif defined(Q_OS_MAC) server.clientFilename = settings.value("client_filename_osx").toString(); + server.clientFilenameOld = settings.value("client_filename_old_osx").toString(); server.configurationFilename = settings.value("configuration_filename_osx").toString(); + server.installerFilename = settings.value("installer_filename_osx").toString(); #else server.clientFilename = settings.value("client_filename_linux").toString(); + server.clientFilenameOld = settings.value("client_filename_old_linux").toString(); server.configurationFilename = settings.value("configuration_filename_linux").toString(); + server.installerFilename = settings.value("installer_filename_linux").toString(); #endif server.comments = settings.value("comments").toString(); @@ -158,13 +164,19 @@ bool CConfigFile::save() const settings.setValue("client_download_filename", server.clientDownloadFilename); #if defined(Q_OS_WIN) settings.setValue("client_filename_windows", server.clientFilename); + settings.setValue("client_filename_old_windows", server.clientFilenameOld); settings.setValue("configuration_filename_windows", server.configurationFilename); + settings.setValue("installer_filename_windows", server.installerFilename); #elif defined(Q_OS_MAC) settings.setValue("client_filename_osx", server.clientFilename); + settings.setValue("client_filename_old_osx", server.clientFilenameOld); settings.setValue("configuration_filename_osx", server.configurationFilename); + settings.setValue("installer_filename_osx", server.installerFilename); #else settings.setValue("client_filename_linux", server.clientFilename); + settings.setValue("client_filename_old_linux", server.clientFilenameOld); settings.setValue("configuration_filename_linux", server.configurationFilename); + settings.setValue("installer_filename_linux", server.installerFilename); #endif settings.setValue("comments", server.comments); @@ -475,8 +487,8 @@ bool CConfigFile::areRyzomDataInstalledIn(const QString &directory) const // at least 200 BNP in data directory if (dir.entryList(QStringList() << "*.bnp", QDir::Files).size() < 200) return false; - // fonts.bnp is required - if (!dir.exists("fonts.bnp")) return false; + // ryzom.ttf or fonts.bnp is required + if (!dir.exists("fonts/ryzom.ttf") && !dir.exists("fonts.bnp")) return false; // gamedev.bnp is required if (!dir.exists("gamedev.bnp")) return false; @@ -499,10 +511,19 @@ bool CConfigFile::isRyzomClientInstalledIn(const QString &directory) const // client_default.cfg doesn't exist if (!dir.exists("client_default.cfg")) return false; - QString clientFilename = getServer().clientFilename; + // current server + CServer server = getServer(); - // check if client is defined and exists - if (!clientFilename.isEmpty() && !dir.exists(clientFilename)) return false; + QString clientFilename = server.clientFilename; + + // check if new client is defined and exists + if (!clientFilename.isEmpty() && !dir.exists(clientFilename)) + { + clientFilename = server.clientFilenameOld; + + // check if old client is defined and exists + if (!dir.exists(clientFilename)) return false; + } // TODO: more checks diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index f0b62ea0d..71756d031 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -35,7 +35,9 @@ struct CServer QString clientDownloadUrl; QString clientDownloadFilename; QString clientFilename; + QString clientFilenameOld; QString configurationFilename; + QString installerFilename; QString comments; }; @@ -148,9 +150,11 @@ public: static QString getOldInstallationLanguage(); static QString getNewInstallationLanguage(); + // status of installation bool isRyzomInstalledIn(const QString &directory) const; bool areRyzomDataInstalledIn(const QString &directory) const; bool isRyzomClientInstalledIn(const QString &directory) const; + bool foundTemporaryFiles(const QString &directory) const; bool shouldCreateDesktopShortcut() const;