From 83c97c6c36fd23c711e08212923a9dcff2011179 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 20:48:30 +0200 Subject: [PATCH 01/15] Changed: Init CSystemUtils in INelContext --HG-- branch : develop --- code/nel/src/misc/app_context.cpp | 7 +++++++ code/ryzom/client/src/init.cpp | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/nel/src/misc/app_context.cpp b/code/nel/src/misc/app_context.cpp index 5206681f9..68ca720ed 100644 --- a/code/nel/src/misc/app_context.cpp +++ b/code/nel/src/misc/app_context.cpp @@ -18,6 +18,7 @@ #include "nel/misc/app_context.h" #include "nel/misc/dynloadlib.h" #include "nel/misc/command.h" +#include "nel/misc/system_utils.h" #include @@ -71,6 +72,9 @@ INelContext::~INelContext() CInstanceCounterLocalManager::releaseInstance(); + // uninit some systems stuff + CSystemUtils::uninit(); + _NelContext = NULL; *(_getInstance()) = NULL; } @@ -90,6 +94,9 @@ void INelContext::contextReady() // set numeric locale to C to avoid the use of decimal separators different of a dot char *locale = setlocale(LC_NUMERIC, "C"); + // init some systems stuff + CSystemUtils::init(); + // register any pending thinks // register local instance counter in the global instance counter manager diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 666e86760..ffc6aa308 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -1154,7 +1154,6 @@ void prelogInit() Driver->setSwapVBLInterval(0); // initialize system utils class - CSystemUtils::init(); CSystemUtils::setWindow(Driver->getDisplay()); CLoginProgressPostThread::getInstance().step(CLoginStep(LoginStep_VideoModeSetupHighColor, "login_step_video_mode_setup_high_color")); From 438744f3bfa65098969f1ad1b3f7a2820c2097c9 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 20:50:23 +0200 Subject: [PATCH 02/15] Changed: Copy Installer in TEMP directory under Windows (to be able to uninstall it) --HG-- branch : develop --- .../tools/client/ryzom_installer/src/main.cpp | 18 +++++- .../client/ryzom_installer/src/utils.cpp | 59 +++++++++++++++++-- .../tools/client/ryzom_installer/src/utils.h | 6 +- 3 files changed, 76 insertions(+), 7 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index 97ba78ce9..4c13e2d25 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -21,6 +21,7 @@ #include "installdialog.h" #include "uninstalldialog.h" #include "operationdialog.h" +#include "utils.h" #ifdef HAVE_CONFIG_H #include "config.h" @@ -60,7 +61,22 @@ int main(int argc, char *argv[]) QApplication::setApplicationVersion(RYZOM_VERSION); QApplication::setWindowIcon(QIcon(":/icons/ryzom.ico")); - // TODO: if not launched from TEMP dir, copy files to TEMP, restart it and exit +#if defined(Q_OS_WIN) && !defined(_DEBUG) + QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation); + + // check if launched from TEMP directory + if (QApplication::applicationDirPath() != tempPath) + { + // copy installer and required files to TEMP directory + if (copyInstallerExecutable(tempPath)) + { + QString tempFile = tempPath + "/" + QFileInfo(QApplication::applicationFilePath()).fileName(); + + // launch copy in TEMP directory with same arguments + if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0; + } + } +#endif QLocale locale = QLocale::system(); diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index d9ebda4c0..ba65bd2ad 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -111,7 +111,7 @@ wchar_t* qToWide(const QString &str) // Shell link, stored in the Comment field of the link // properties. -bool CreateLink(const QString &pathObj, const QString &pathLink, const QString &arguments, const QString &workingDir, const QString &desc) +bool createLink(const QString &pathObj, const QString &pathLink, const QString &arguments, const QString &workingDir, const QString &desc) { IShellLinkW* psl; @@ -163,7 +163,7 @@ bool CreateLink(const QString &pathObj, const QString &pathLink, const QString & // Shell link, stored in the Comment field of the link // properties. -bool ResolveLink(const QWidget &window, const QString &linkFile, QString &path) +bool resolveLink(const QWidget &window, const QString &linkFile, QString &path) { IShellLinkW* psl; WIN32_FIND_DATAW wfd; @@ -232,14 +232,65 @@ bool ResolveLink(const QWidget &window, const QString &linkFile, QString &path) #else -bool CreateLink(const QString &pathObj, const QString &pathLink, const QString &arguments, const QString &workingDir, const QString &desc) +bool createLink(const QString &pathObj, const QString &pathLink, const QString &arguments, const QString &workingDir, const QString &desc) { + // TODO: create .desktop file under Linux + return false; } -bool ResolveLink(const QWidget &window, const QString &pathLink, QString &pathObj) +bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathObj) { return false; } #endif + +bool copyInstallerExecutable(const QString &destination) +{ + QString path = QApplication::applicationDirPath(); + + QStringList files; +#ifdef Q_OS_WIN + + // VC++ runtimes +#if _MSC_VER == 1900 + files << "msvcp140.dll"; + files << "msvcr140.dll"; +#else _MSC_VER == 1600 + files << "msvcp100.dll"; + files << "msvcr100.dll"; +#endif + +#else +#endif + + files << QFileInfo(QApplication::applicationFilePath()).fileName(); + + foreach(const QString &file, files) + { + // convert to absolute path + QString srcPath = path + "/" + file; + QString dstPath = destination + "/" + file; + + if (QFile::exists(srcPath)) + { + if (QFile::exists(dstPath)) + { + if (!QFile::remove(dstPath)) + { + qDebug() << "Unable to delete" << dstPath; + } + } + + if (!QFile::copy(srcPath, dstPath)) + { + qDebug() << "Unable to copy" << srcPath << "to" << dstPath; + + return false; + } + } + } + + return true; +} diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.h b/code/ryzom/tools/client/ryzom_installer/src/utils.h index 6c2533076..c729ba2cb 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.h +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.h @@ -48,7 +48,9 @@ QString qFromWide(const wchar_t *str); wchar_t* qToWide(const QString &str); -bool CreateLink(const QString &pathObj, const QString &pathLink, const QString &arguments, const QString &workingDir, const QString &desc); -bool ResolveLink(const QWidget &window, const QString &pathLink, QString &pathObj); +bool createLink(const QString &pathObj, const QString &pathLink, const QString &arguments, const QString &workingDir, const QString &desc); +bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathObj); + +bool copyInstallerExecutable(const QString &destination); #endif From 4494dc42bc5deff6966af89190a63516ddbfee54 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:02:17 +0200 Subject: [PATCH 03/15] Changed: Use SComponents for added or removed components --HG-- branch : develop --- .../tools/client/ryzom_installer/src/main.cpp | 2 +- .../client/ryzom_installer/src/mainwindow.cpp | 2 +- .../client/ryzom_installer/src/operation.h | 4 +- .../ryzom_installer/src/operationdialog.cpp | 177 +++++++++++------- .../ryzom_installer/src/operationdialog.h | 13 +- .../ryzom_installer/src/uninstalldialog.cpp | 6 +- .../ryzom_installer/src/uninstalldialog.h | 4 +- 7 files changed, 133 insertions(+), 75 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index 4c13e2d25..dfe588000 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) if (parser.isSet(uninstallOption)) { - SUninstallComponents components; + SComponents components; // add all servers by default for (int i = 0; i < config.getServersCount(); ++i) diff --git a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp index 27bd38a32..2c1be9a72 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp @@ -193,7 +193,7 @@ void CMainWindow::onUninstall() { CConfigFile *config = CConfigFile::getInstance(); - SUninstallComponents components; + SComponents components; // add all servers by default for (int i = 0; i < config->getServersCount(); ++i) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operation.h b/code/ryzom/tools/client/ryzom_installer/src/operation.h index 4c3a88c07..4e8b016be 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operation.h +++ b/code/ryzom/tools/client/ryzom_installer/src/operation.h @@ -33,9 +33,9 @@ public: virtual bool operationShouldStop() =0; }; -struct SUninstallComponents +struct SComponents { - SUninstallComponents() + SComponents() { installer = true; } diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index fe5c8f372..405973724 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -22,6 +22,7 @@ #include "config.h" #include "profilesmodel.h" #include "utils.h" +#include "nel/misc/path.h" #include "filescopier.h" #include "filesextractor.h" @@ -82,9 +83,9 @@ void COperationDialog::setOperation(OperationType operation) m_operation = operation; } -void COperationDialog::setUninstallComponents(const SUninstallComponents &components) +void COperationDialog::setUninstallComponents(const SComponents &components) { - m_components = components; + m_removeComponents = components; } void COperationDialog::processNextStep() @@ -191,21 +192,28 @@ void COperationDialog::processInstallNextStep() } } -void COperationDialog::processUpdateProfilesNextStep() +void COperationDialog::updateAddRemoveComponents() { - // TODO: check all servers are downloaded - // TODO: delete profiles directories that are not used anymore - // TODO: create shortcuts - QStringList serversToUpdate; + QStringList profilesToDelete; + QStringList profilesToAdd; CConfigFile *config = CConfigFile::getInstance(); - // append all old profiles + foreach(const CProfile &profile, config->getProfiles()) + { + // append all new profiles + profilesToAdd << profile.id; + } + foreach(const CProfile &profile, config->getBackupProfiles()) { - if (QFile::exists(profile.getDirectory())) profilesToDelete << profile.id; + // append all old profiles + profilesToDelete << profile.id; + + // remove profiles that didn't exist + profilesToAdd.removeAll(profile.id); } const CServer &defaultServer = config->getServer(); @@ -226,84 +234,118 @@ void COperationDialog::processUpdateProfilesNextStep() profilesToDelete.removeAll(profile.id); } - if (!profilesToDelete.isEmpty()) - { - m_components.profiles << profilesToDelete; + // update components to remove + m_removeComponents.profiles << profilesToDelete; + m_removeComponents.installer = false; + // update components to add + m_addComponents.profiles << profilesToAdd; + m_addComponents.servers << serversToUpdate; + m_addComponents.installer = false; +} + +void COperationDialog::processUpdateProfilesNextStep() +{ + // for "update profiles" operations, we set installer to false when components are updated, + // since we're not using this variable + if (m_addComponents.installer && m_removeComponents.installer) + { + updateAddRemoveComponents(); + } + // TODO: check all servers are downloaded + // TODO: delete profiles directories that are not used anymore + // TODO: create shortcuts + + + if (!m_removeComponents.profiles.isEmpty()) + { // delete profiles in another thread QtConcurrent::run(this, &COperationDialog::deleteComponentsProfiles); - return; } - // servers files to download/update - foreach(const QString &serverId, serversToUpdate) + if (!m_addComponents.profiles.isEmpty()) { - const CServer &server = config->getServer(serverId); + // add profiles in another thread + QtConcurrent::run(this, &COperationDialog::addComponentsProfiles); + return; + } - // data - if (!config->areRyzomDataInstalledIn(server.getDirectory())) + if (!m_addComponents.servers.isEmpty()) + { + CConfigFile *config = CConfigFile::getInstance(); + const CServer &defaultServer = config->getServer(); + + // servers files to download/update + foreach(const QString &serverId, m_addComponents.servers) { - QString dataFile = config->getInstallationDirectory() + "/" + server.dataDownloadFilename; + const CServer &server = config->getServer(serverId); - // archive already downloaded - if (QFile::exists(dataFile)) + // data + if (!config->areRyzomDataInstalledIn(server.getDirectory())) { - // make server current - m_currentServerId = server.id; + QString dataFile = config->getInstallationDirectory() + "/" + server.dataDownloadFilename; - // uncompress it - QtConcurrent::run(this, &COperationDialog::extractDownloadedData); - return; - } + // archive already downloaded + if (QFile::exists(dataFile)) + { + // make server current + m_currentServerId = server.id; - // data download URLs are different, can't copy data from default server - if (server.dataDownloadUrl != defaultServer.dataDownloadUrl) - { - // download it - // TODO + // uncompress it + QtConcurrent::run(this, &COperationDialog::extractDownloadedData); + return; + } - return; - } - - // same data used - - // copy them - // TODO - return; - } - - // client - if (!config->isRyzomClientInstalledIn(server.getDirectory())) - { - // client download URLs are different, can't copy client from default server - if (server.clientDownloadUrl == defaultServer.clientDownloadUrl) - { - if (QFile::exists("")) + // data download URLs are different, can't copy data from default server + if (server.dataDownloadUrl != defaultServer.dataDownloadUrl) + { + // download it downloadData(); + return; + } + + // same data used + + // copy them + // TODO return; } - } - else - { - QString clientFile = config->getInstallationDirectory() + "/" + config->expandVariables(server.clientDownloadFilename); + + // client + if (!config->isRyzomClientInstalledIn(server.getDirectory())) + { + // client download URLs are different, can't copy client from default server + if (server.clientDownloadUrl == defaultServer.clientDownloadUrl) + { + if (QFile::exists("")) + downloadData(); + return; + } + } + else + { + QString clientFile = config->getInstallationDirectory() + "/" + config->expandVariables(server.clientDownloadFilename); + } } } + + updateAddRemoveEntry(); } void COperationDialog::processUninstallNextStep() { CConfigFile *config = CConfigFile::getInstance(); - if (!m_components.servers.isEmpty()) + if (!m_removeComponents.servers.isEmpty()) { QtConcurrent::run(this, &COperationDialog::deleteComponentsServers); } - else if (!m_components.profiles.isEmpty()) + else if (!m_removeComponents.profiles.isEmpty()) { QtConcurrent::run(this, &COperationDialog::deleteComponentsProfiles); } - else if (m_components.installer) + else if (m_removeComponents.installer) { QtConcurrent::run(this, &COperationDialog::deleteComponentsInstaller); } @@ -916,14 +958,14 @@ void COperationDialog::deleteComponentsServers() m_currentOperationProgressFormat = tr("Deleting %1..."); emit prepare(); - emit init(0, m_components.servers.size()); + emit init(0, m_removeComponents.servers.size()); emit start(); CConfigFile *config = CConfigFile::getInstance(); int i = 0; - foreach(const QString &serverId, m_components.servers) + foreach(const QString &serverId, m_removeComponents.servers) { if (operationShouldStop()) { @@ -949,7 +991,11 @@ void COperationDialog::deleteComponentsServers() } } - emit success(m_components.servers.size()); + emit success(m_removeComponents.servers.size()); + + // clear list of all servers to uninstall + m_removeComponents.servers.clear(); + emit done(); } @@ -959,13 +1005,13 @@ void COperationDialog::deleteComponentsProfiles() m_currentOperationProgressFormat = tr("Deleting profile %1..."); emit prepare(); - emit init(0, m_components.servers.size()); + emit init(0, m_removeComponents.servers.size()); CConfigFile *config = CConfigFile::getInstance(); int i = 0; - foreach(const QString &profileId, m_components.profiles) + foreach(const QString &profileId, m_removeComponents.profiles) { if (operationShouldStop()) { @@ -990,14 +1036,17 @@ void COperationDialog::deleteComponentsProfiles() } } + // TODO: delete links + // delete profile config->removeProfile(profileId); } - // clear list of all profiles to uninstall - m_components.profiles.clear(); + emit success(m_removeComponents.profiles.size()); + + // clear list of all profiles to uninstall + m_removeComponents.profiles.clear(); - emit success(m_components.servers.size()); emit done(); } diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h index a170c30a0..f8152718e 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h @@ -39,7 +39,7 @@ public: virtual ~COperationDialog(); void setOperation(OperationType operation); - void setUninstallComponents(const SUninstallComponents &components); + void setUninstallComponents(const SComponents &components); public slots: void onAbortClicked(); @@ -106,10 +106,18 @@ protected: bool createClientMenuShortcut(int profileIndex); bool createAddRemoveEntry(); bool deleteAddRemoveEntry(); + + void addComponentsServers(); void deleteComponentsServers(); + + void addComponentsProfiles(); void deleteComponentsProfiles(); + + void addComponentsInstaller(); void deleteComponentsInstaller(); + void updateAddRemoveComponents(); + // from CFilesCopier virtual void operationPrepare(); virtual void operationInit(qint64 current, qint64 total); @@ -133,7 +141,8 @@ protected: bool m_aborting; OperationType m_operation; - SUninstallComponents m_components; + SComponents m_addComponents; + SComponents m_removeComponents; QString m_currentServerId; }; diff --git a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp index 62763063b..4c61da6d5 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.cpp @@ -114,7 +114,7 @@ void CUninstallDialog::showEvent(QShowEvent *event) QtConcurrent::run(this, &CUninstallDialog::updateSizes); } -void CUninstallDialog::setSelectedComponents(const SUninstallComponents &components) +void CUninstallDialog::setSelectedComponents(const SComponents &components) { QStandardItemModel *model = qobject_cast(componentsTreeView->model()); if (model == NULL) return; @@ -150,9 +150,9 @@ void CUninstallDialog::setSelectedComponents(const SUninstallComponents &compone if (item) item->setCheckState(components.installer ? Qt::Checked : Qt::Unchecked); } -SUninstallComponents CUninstallDialog::getSelectedCompenents() const +SComponents CUninstallDialog::getSelectedCompenents() const { - SUninstallComponents res; + SComponents res; QStandardItemModel *model = qobject_cast(componentsTreeView->model()); if (model == NULL) return res; diff --git a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.h b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.h index 08f7f536d..f8bebace1 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/uninstalldialog.h @@ -35,8 +35,8 @@ public: CUninstallDialog(QWidget *parent = NULL); virtual ~CUninstallDialog(); - void setSelectedComponents(const SUninstallComponents &components); - SUninstallComponents getSelectedCompenents() const; + void setSelectedComponents(const SComponents &components); + SComponents getSelectedCompenents() const; signals: void updateSize(int row, const QString &text); From 7dac03f6ecae194d7ce95fdeb84b7522268f88b9 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:04:00 +0200 Subject: [PATCH 04/15] Changed: More helpers --HG-- branch : develop --- .../client/ryzom_installer/src/configfile.cpp | 117 +++++++++++++----- .../client/ryzom_installer/src/configfile.h | 13 +- .../client/ryzom_installer/src/mainwindow.cpp | 5 +- .../ryzom_installer/src/profilesdialog.cpp | 12 +- 4 files changed, 106 insertions(+), 41 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 594bf9d1c..2543d03fa 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -32,11 +32,52 @@ QString CServer::getDirectory() const return CConfigFile::getInstance()->getInstallationDirectory() + "/" + id; } +QString CServer::getClientFullPath() const +{ + if (clientFilename.isEmpty()) return ""; + + return getDirectory() + "/" + clientFilename; +} + +QString CServer::getConfigurationFullPath() const +{ + if (configurationFilename.isEmpty()) return ""; + + return getDirectory() + "/" + configurationFilename; +} + QString CProfile::getDirectory() const { return CConfigFile::getInstance()->getProfileDirectory() + "/" + id; } +QString CProfile::getClientFullPath() const +{ + if (!executable.isEmpty()) return executable; + + const CServer &s = CConfigFile::getInstance()->getServer(server); + + return s.getClientFullPath(); +} + +QString CProfile::getClientDesktopLinkFullPath() const +{ +#ifdef Q_OS_WIN32 + return CConfigFile::getInstance()->getDesktopDirectory() + "/" + name + ".lnk"; +#else + return ""; +#endif +} + +QString CProfile::getClientMenuLinkFullPath() const +{ +#ifdef Q_OS_WIN32 + return CConfigFile::getInstance()->getMenuDirectory() + "/" + name + ".lnk"; +#else + return ""; +#endif +} + CConfigFile *CConfigFile::s_instance = NULL; CConfigFile::CConfigFile(QObject *parent):QObject(parent), m_defaultServerIndex(0), m_defaultProfileIndex(0), m_use64BitsClient(false), m_shouldUninstallOldClient(true) @@ -323,6 +364,16 @@ void CConfigFile::removeProfile(const QString &id) } } +QString CConfigFile::getDesktopDirectory() const +{ + return QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); +} + +QString CConfigFile::getMenuDirectory() const +{ + return QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation) + "/" + QApplication::applicationName(); +} + bool CConfigFile::has64bitsOS() { return QSysInfo::currentCpuArchitecture() == "x86_64"; @@ -380,9 +431,28 @@ QString CConfigFile::getProfileDirectory() const QString CConfigFile::getSrcProfileDirectory() const { - if (QFile::exists(getSrcServerDirectory() + "/client.cfg")) return getSrcServerDirectory(); + QString filename = "client.cfg"; - return qFromUtf8(NLMISC::CPath::getApplicationDirectory("Ryzom")); + QStringList paths; + + // same path as client + paths << getSrcServerDirectory(); + + // profile path root + paths << getProfileDirectory(); + +#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC) + // specific path under Linux + paths << QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.ryzom"; +#endif + + // search config file in these locations + foreach(const QString &path, paths) + { + if (QFile::exists(path + "/" + filename)) return path; + } + + return ""; } bool CConfigFile::use64BitsClient() const @@ -608,10 +678,12 @@ bool CConfigFile::foundTemporaryFiles(const QString &directory) const bool CConfigFile::shouldCreateDesktopShortcut() const { -#ifdef Q_OS_WIN32 const CProfile &profile = getProfile(); - return profile.desktopShortcut && !NLMISC::CFile::isExists(qToUtf8(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/Ryzom.lnk")); + if (!profile.desktopShortcut) return false; + +#ifdef Q_OS_WIN32 + return !NLMISC::CFile::isExists(qToUtf8(profile.getClientDesktopLinkFullPath())); #else return false; #endif @@ -619,42 +691,29 @@ bool CConfigFile::shouldCreateDesktopShortcut() const bool CConfigFile::shouldCreateMenuShortcut() const { -#ifdef Q_OS_WIN32 const CProfile &profile = getProfile(); - return profile.menuShortcut && !NLMISC::CFile::isExists(qToUtf8(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation) + "/Ryzom/Ryzom.lnk")); + if (!profile.menuShortcut) return false; + +#ifdef Q_OS_WIN32 + return !NLMISC::CFile::isExists(qToUtf8(profile.getClientMenuLinkFullPath())); #else return false; #endif } -QString CConfigFile::getProfileClientFullPath(int profileIndex) const +QString CConfigFile::getInstallerFullPath() const { - const CProfile &profile = getProfile(profileIndex); - - QString path = profile.executable; - - if (!path.isEmpty()) return path; - - return getServerClientFullPath(profile.server); + return QApplication::applicationFilePath(); } -QString CConfigFile::getServerClientFullPath(const QString &serverId) const +QString CConfigFile::getInstallerMenuLinkFullPath() const { - const CServer &server = getServer(serverId); - - if (server.clientFilename.isEmpty()) return ""; - - return server.getDirectory() + "/" + server.clientFilename; -} - -QString CConfigFile::getServerConfigurationFullPath(const QString &serverId) const -{ - const CServer &server = getServer(serverId); - - if (server.configurationFilename.isEmpty()) return ""; - - return server.getDirectory() + "/" + server.configurationFilename; +#ifdef Q_OS_WIN32 + return QString("%1/%2/%2 Installer.lnk").arg(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)).arg(QApplication::applicationName()); +#else + return ""; +#endif } QString CConfigFile::getSrcServerClientBNPFullPath() const diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index dd00b94e8..cc4c02b79 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -45,6 +45,8 @@ public: // helpers QString getDirectory() const; + QString getClientFullPath() const; + QString getConfigurationFullPath() const; }; extern const CServer NoServer; @@ -71,6 +73,9 @@ public: // helpers QString getDirectory() const; + QString getClientFullPath() const; + QString getClientDesktopLinkFullPath() const; + QString getClientMenuLinkFullPath() const; }; extern const CProfile NoProfile; @@ -135,6 +140,9 @@ public: QString getProfileDirectory() const; QString getSrcProfileDirectory() const; + QString getDesktopDirectory() const; + QString getMenuDirectory() const; + static bool has64bitsOS(); // default directories @@ -166,9 +174,8 @@ public: QString getClientArch() const; - QString getProfileClientFullPath(int profileIndex = -1) const; - QString getServerClientFullPath(const QString &serverId = "") const; - QString getServerConfigurationFullPath(const QString &serverId = "") const; + QString getInstallerFullPath() const; + QString getInstallerMenuLinkFullPath() const; QString getSrcServerClientBNPFullPath() const; diff --git a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp index 2c1be9a72..55aa3b5bc 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/mainwindow.cpp @@ -95,7 +95,7 @@ void CMainWindow::onPlayClicked() const CServer &server = config->getServer(profile.server); // get full path of client executable - QString executable = config->getProfileClientFullPath(profileIndex); + QString executable = profile.getClientFullPath(); if (executable.isEmpty() || !QFile::exists(executable)) return; @@ -121,8 +121,9 @@ void CMainWindow::onConfigureClicked() CConfigFile *config = CConfigFile::getInstance(); const CProfile &profile = config->getProfile(profileIndex); + const CServer &server = config->getServer(profile.server); - QString executable = config->getServerConfigurationFullPath(profile.server); + QString executable = server.getConfigurationFullPath(); if (executable.isEmpty() || !QFile::exists(executable)) return; diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp index cbfcacaf8..8a5b84b0a 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp @@ -103,7 +103,7 @@ void CProfilesDialog::displayProfile(int index) if (executable.isEmpty()) { - executable = CConfigFile::getInstance()->getServerClientFullPath(profile.server); + executable = profile.getClientFullPath(); } QString profileDirectory = profile.getDirectory(); @@ -216,7 +216,7 @@ void CProfilesDialog::updateExecutableVersion(int index) // file empty, use default one if (executable.isEmpty()) { - executable += CConfigFile::getInstance()->getServerClientFullPath(profile.server); + executable += CConfigFile::getInstance()->getServer(profile.server).getClientFullPath(); } // file doesn't exist @@ -264,18 +264,16 @@ void CProfilesDialog::onExecutableBrowseClicked() CProfile &profile = m_model->getProfiles()[m_currentProfileIndex]; QString executable = profile.executable; + QString defaultExecutable = CConfigFile::getInstance()->getServer(profile.server).getClientFullPath(); - if (executable.isEmpty()) - { - executable = CConfigFile::getInstance()->getServerClientFullPath(profile.server); - } + if (executable.isEmpty()) executable = defaultExecutable; executable = QFileDialog::getOpenFileName(this, tr("Please choose Ryzom client executable to launch"), executable, tr("Executables (*.exe)")); if (executable.isEmpty()) return; // don't need to save the new executable if the same as default one - if (executable == CConfigFile::getInstance()->getServerClientFullPath(profile.server)) + if (executable == defaultExecutable) { profile.executable.clear(); } From a7ca5eaac2dc75028d1c63287de7495ec04f23ac Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:04:31 +0200 Subject: [PATCH 05/15] Changed: Support old and new data files --HG-- branch : develop --- .../client/ryzom_installer/src/configfile.cpp | 14 +++++++-- .../ryzom_installer/src/filescleaner.cpp | 31 ++++++++----------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 2543d03fa..47315f6ac 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -667,11 +667,21 @@ bool CConfigFile::foundTemporaryFiles(const QString &directory) const if (!dir.cd("data") && dir.exists()) return false; + QStringList filter; + filter << "*.string_cache"; + + if (dir.exists("packed_sheets.bnp")) + { + filter << "*.packed_sheets"; + filter << "*.packed"; + filter << "*.pem"; + } + // temporary files - if (!dir.entryList(QStringList() << "*.string_cache" << "*.packed_sheets" << "*.packed" << "*.pem", QDir::Files).isEmpty()) return true; + if (!dir.entryList(filter, QDir::Files).isEmpty()) return true; // fonts directory is not needed anymore - if (dir.cd("fonts") && dir.exists()) return true; + if (dir.exists("fonts.bnp") && dir.cd("fonts") && dir.exists()) return true; return false; } diff --git a/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp b/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp index 79c42634a..2f310e056 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/filescleaner.cpp @@ -17,21 +17,6 @@ #include "stdpch.h" #include "filescleaner.h" #include "operation.h" -#include "utils.h" - -#include "nel/misc/big_file.h" -#include "nel/misc/callback.h" -#include "nel/misc/file.h" -#include "nel/misc/path.h" - -#include "7z.h" -#include "7zAlloc.h" -#include "7zBuf.h" -#include "7zCrc.h" - -#include "qzipreader.h" - -#include #ifdef DEBUG_NEW #define new DEBUG_NEW @@ -63,8 +48,18 @@ bool CFilesCleaner::exec() if (!dir.cd("data") && dir.exists()) return false; + QStringList filter; + filter << "*.string_cache"; + + if (dir.exists("packed_sheets.bnp")) + { + filter << "*.packed_sheets"; + filter << "*.packed"; + filter << "*.pem"; + } + // temporary files - QStringList files = dir.entryList(QStringList() << "*.string_cache" << "*.packed_sheets" << "*.packed" << "*.pem", QDir::Files); + QStringList files = dir.entryList(filter, QDir::Files); if (m_listener) { @@ -83,8 +78,8 @@ bool CFilesCleaner::exec() ++filesCount; } - // fonts directory is not needed anymore - if (dir.cd("fonts") && dir.exists()) + // fonts directory is not needed anymore if fonts.bnp exists + if (dir.exists("fonts.bnp") && dir.cd("fonts") && dir.exists()) { dir.removeRecursively(); } From b6722dba2467bfda3ffe0a597867c94d7e975546 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:05:14 +0200 Subject: [PATCH 06/15] Fixed: Close dialog when clicking on Abort --HG-- branch : develop --- .../tools/client/ryzom_installer/src/operationdialog.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 405973724..8252ffc63 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -90,6 +90,12 @@ void COperationDialog::setUninstallComponents(const SComponents &components) void COperationDialog::processNextStep() { + if (operationShouldStop()) + { + reject(); + return; + } + switch (m_operation) { case OperationMigrate: @@ -473,7 +479,7 @@ void COperationDialog::onProgressFail(const QString &error) void COperationDialog::onDone() { - if (!operationShouldStop()) processNextStep(); + processNextStep(); } void COperationDialog::downloadData() From f27b388b11ab5a9370a94c1a2fee6fb8d92444b1 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:06:00 +0200 Subject: [PATCH 07/15] Changed: Delete menu directory when uninstalling Installer --HG-- branch : develop --- .../client/ryzom_installer/src/operationdialog.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 8252ffc63..7b535a221 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -1067,7 +1067,19 @@ void COperationDialog::deleteComponentsInstaller() deleteAddRemoveEntry(); - emit onProgressSuccess(m_components.servers.size()); + // delete menu + QString path = config->getMenuDirectory(); + + if (!path.isEmpty()) + { + QDir dir(path); + + dir.removeRecursively(); + } + + // TODO: + + emit onProgressSuccess(1); emit done(); } From cb9acedb72fb981e5a7d63a723338d47dc9ba6c7 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:06:49 +0200 Subject: [PATCH 08/15] Changed: Create shortcut in menu for Installer --HG-- branch : develop --- .../ryzom_installer/src/operationdialog.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 7b535a221..69ea6bdc2 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -724,6 +724,26 @@ void COperationDialog::copyInstaller() QFile::rename(oldInstallerFullPath, newInstallerFullPath); } } + + // create menu directory if defined + QString path = config->getMenuDirectory(); + + if (!path.isEmpty()) + { + QDir dir; + + if (!dir.mkpath(path)) + { + qDebug() << "Unable to create directory" << path; + } + } + + // create installer link in menu + QString executable = newInstallerFullPath; + QString shortcut = config->getInstallerMenuLinkFullPath(); + QString desc = "Ryzom Installer"; + + createLink(executable, shortcut, "", "", desc); } // TODO: create shortcuts for installer From 7b6dd8f0312ccd17de609cfaf29cc1bbf97e234a Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:07:51 +0200 Subject: [PATCH 09/15] Changed: Use ID instead of index for profile and server --HG-- branch : develop --- .../ryzom_installer/src/operationdialog.cpp | 35 ++++++++++++------- .../ryzom_installer/src/operationdialog.h | 6 ++-- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 69ea6bdc2..d3626fdd5 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -865,11 +865,11 @@ bool COperationDialog::createDefaultProfile() return true; } -bool COperationDialog::createClientDesktopShortcut(int profileIndex) +bool COperationDialog::createClientDesktopShortcut(const QString &profileId) { CConfigFile *config = CConfigFile::getInstance(); - const CProfile &profile = config->getProfile(profileIndex); + const CProfile &profile = config->getProfile(profileId); const CServer &server = config->getServer(profile.server); m_currentOperation = tr("Create desktop shortcut for profile %1").arg(profile.id); @@ -877,8 +877,16 @@ bool COperationDialog::createClientDesktopShortcut(int profileIndex) #ifdef Q_OS_WIN32 if (profile.desktopShortcut) { - QString shortcut = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/Ryzom.lnk"; - CreateLink(config->getProfileClientFullPath(), shortcut, QString("--profile %1 %2").arg(profile.id).arg(profile.arguments), server.getDirectory(), "Default Ryzom client"); + QString executable = profile.getClientFullPath(); + QString shortcut = profile.getClientDesktopLinkFullPath(); + QString workingDir = server.getDirectory(); + + QString arguments = QString("--profile %1").arg(profile.id); + + // append custom arguments + if (!profile.arguments.isEmpty()) arguments += QString(" %1").arg(profile.arguments); + + createLink(executable, shortcut, arguments, workingDir, profile.comments); } #endif @@ -887,11 +895,11 @@ bool COperationDialog::createClientDesktopShortcut(int profileIndex) return true; } -bool COperationDialog::createClientMenuShortcut(int profileIndex) +bool COperationDialog::createClientMenuShortcut(const QString &profileId) { CConfigFile *config = CConfigFile::getInstance(); - const CProfile &profile = config->getProfile(profileIndex); + const CProfile &profile = config->getProfile(profileId); const CServer &server = config->getServer(profile.server); m_currentOperation = tr("Create menu shortcut for profile %1").arg(profile.id); @@ -899,15 +907,16 @@ bool COperationDialog::createClientMenuShortcut(int profileIndex) #ifdef Q_OS_WIN32 if (profile.menuShortcut) { - QString path = QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation) + "/Ryzom"; + QString executable = profile.getClientFullPath(); + QString shortcut = profile.getClientMenuLinkFullPath(); + QString workingDir = server.getDirectory(); - QDir dir; + QString arguments = QString("--profile %1").arg(profile.id); - if (dir.mkpath(path)) - { - QString shortcut = path + "/Ryzom.lnk"; - CreateLink(config->getProfileClientFullPath(), shortcut, QString("--profile %1 %2").arg(profile.id).arg(profile.arguments), server.getDirectory(), "Default Ryzom client"); - } + // append custom arguments + if (!profile.arguments.isEmpty()) arguments += QString(" %1").arg(profile.arguments); + + createLink(executable, shortcut, arguments, workingDir, profile.comments); } #endif diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h index f8152718e..34a322fff 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h @@ -102,8 +102,10 @@ protected: void copyInstaller(); void uninstallOldClient(); bool createDefaultProfile(); - bool createClientDesktopShortcut(int profileIndex); - bool createClientMenuShortcut(int profileIndex); + + bool createClientDesktopShortcut(const QString &profileId); + bool createClientMenuShortcut(const QString &profileId); + bool createAddRemoveEntry(); bool deleteAddRemoveEntry(); From 50d73127cbd17d76cbecb0afd9957e181510bef9 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:08:23 +0200 Subject: [PATCH 10/15] Changed: Update Add/Remove program --HG-- branch : develop --- .../ryzom_installer/src/operationdialog.cpp | 31 +++++++++++++++++++ .../ryzom_installer/src/operationdialog.h | 1 + 2 files changed, 32 insertions(+) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index d3626fdd5..f858ec600 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -975,6 +975,37 @@ bool COperationDialog::createAddRemoveEntry() return true; } +bool COperationDialog::updateAddRemoveEntry() +{ + CConfigFile *config = CConfigFile::getInstance(); + + const CServer &server = config->getServer(); + + QString oldInstallerFilename = server.clientFilenameOld; + QString newInstallerFilename = server.installerFilename; + + if (!oldInstallerFilename.isEmpty() && !newInstallerFilename.isEmpty()) + { + QString oldInstallerFullPath = config->getSrcServerDirectory() + "/" + oldInstallerFilename; + QString newInstallerFullPath = config->getInstallationDirectory() + "/" + newInstallerFilename; + + if (QFile::exists(newInstallerFullPath)) + { +#ifdef Q_OS_WIN + QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Ryzom", QSettings::NativeFormat); + QStringList versionTokens = QApplication::applicationVersion().split('.'); + + settings.setValue("DisplayVersion", QApplication::applicationVersion()); + settings.setValue("EstimatedSize", getDirectorySize(config->getInstallationDirectory())); + settings.setValue("MajorVersion", versionTokens[0].toInt()); + settings.setValue("MinorVersion", versionTokens[1].toInt()); +#endif + } + } + + return true; +} + bool COperationDialog::deleteAddRemoveEntry() { #ifdef Q_OS_WIN diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h index 34a322fff..bae2a8b7f 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.h @@ -107,6 +107,7 @@ protected: bool createClientMenuShortcut(const QString &profileId); bool createAddRemoveEntry(); + bool updateAddRemoveEntry(); bool deleteAddRemoveEntry(); void addComponentsServers(); From 0808ab8d3f5bf34243202d44097787c17598060a Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:08:49 +0200 Subject: [PATCH 11/15] Changed: Create client shortcuts for profile --HG-- branch : develop --- .../ryzom_installer/src/operationdialog.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index f858ec600..ebcb1c722 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -1065,6 +1065,23 @@ void COperationDialog::deleteComponentsServers() emit done(); } +void COperationDialog::addComponentsProfiles() +{ + m_currentOperation = tr("Add profiles"); + m_currentOperationProgressFormat = tr("Adding profile %1..."); + + CConfigFile *config = CConfigFile::getInstance(); + + foreach(const QString &profileId, m_addComponents.profiles) + { + CProfile &profile = config->getProfile(profileId); + + if (profile.desktopShortcut) createClientDesktopShortcut(profile.id); + + if (profile.menuShortcut) createClientMenuShortcut(profile.id); + } +} + void COperationDialog::deleteComponentsProfiles() { m_currentOperation = tr("Delete profiles"); From bea8c9bfa10016ee4490f13b9d4fe21b9815753c Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:09:05 +0200 Subject: [PATCH 12/15] Changed: Minor change --HG-- branch : develop --- code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index ebcb1c722..d4c322a8c 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -746,8 +746,6 @@ void COperationDialog::copyInstaller() createLink(executable, shortcut, "", "", desc); } - // TODO: create shortcuts for installer - emit done(); } From 443355b6c875cd6d080ebfd2b665dfe419cb3f80 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:09:26 +0200 Subject: [PATCH 13/15] Changed: Use application name instead of hardcoded value --HG-- branch : develop --- code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index d4c322a8c..f049f17a8 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -947,7 +947,7 @@ bool COperationDialog::createAddRemoveEntry() settings.setValue("Comments", ""); settings.setValue("DisplayIcon", nativeFullPath + ",0"); - settings.setValue("DisplayName", "Ryzom"); + settings.setValue("DisplayName", QApplication::applicationName()); settings.setValue("DisplayVersion", RYZOM_VERSION); settings.setValue("EstimatedSize", 1500000); // TODO: compute real size settings.setValue("InstallDate", QDateTime::currentDateTime().toString("Ymd")); From 061ead00f4d2e9913a23a0a5c49d8f4a1c2ce478 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:09:41 +0200 Subject: [PATCH 14/15] Changed: Computes size of servers --HG-- branch : develop --- code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index f049f17a8..617c5f613 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -949,7 +949,7 @@ bool COperationDialog::createAddRemoveEntry() settings.setValue("DisplayIcon", nativeFullPath + ",0"); settings.setValue("DisplayName", QApplication::applicationName()); settings.setValue("DisplayVersion", RYZOM_VERSION); - settings.setValue("EstimatedSize", 1500000); // TODO: compute real size + settings.setValue("EstimatedSize", getDirectorySize(config->getInstallationDirectory())); settings.setValue("InstallDate", QDateTime::currentDateTime().toString("Ymd")); settings.setValue("InstallLocation", config->getInstallationDirectory()); settings.setValue("MajorVersion", versionTokens[0].toInt()); From 36a4c6dce7cfe93032edc68c9c5cfdfc07dfce22 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 19 Jun 2016 21:09:51 +0200 Subject: [PATCH 15/15] Changed: Minor changes --HG-- branch : develop --- code/ryzom/tools/client/ryzom_installer/ui/operationdialog.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/ui/operationdialog.ui b/code/ryzom/tools/client/ryzom_installer/ui/operationdialog.ui index 25a24c65a..62ae32ab4 100644 --- a/code/ryzom/tools/client/ryzom_installer/ui/operationdialog.ui +++ b/code/ryzom/tools/client/ryzom_installer/ui/operationdialog.ui @@ -38,14 +38,14 @@ - TextLabel + Operation - TextLabel + Operation progress