From 91221fd4ce7c134dd928c3e46d9383c11947dc80 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 21 Sep 2016 15:19:22 +0200 Subject: [PATCH 1/5] Fixed: Wrong French translation (copy-paste...), see #279 --HG-- branch : develop --- .../client/ryzom_installer/translations/ryzom_installer_fr.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_fr.ts b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_fr.ts index 705b70452..0a42d8362 100644 --- a/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_fr.ts +++ b/code/ryzom/tools/client/ryzom_installer/translations/ryzom_installer_fr.ts @@ -559,9 +559,9 @@ This program will migrate Ryzom version 2.1 to 3.0. Your files will be updated, Just press Continue button and follow the different steps until everything is done. Bienvenue dans l'Installateur de Ryzom ! -Ce programme vous permettra de télécharger, installer, configurer et gérer Ryzom sur votre ordinateur. +Ce programme vous permettra de migrer Ryzom de la version 2.1 à 3.0. Vos fichiers seront mis à jour, nettoyés et déplacés vers un nouvel emplacement. -Vous n'avez qu'à suivre les différentes étapes et faire un choix entre les différentes options proposées. +Vous n'avez qu'à cliquer sur Suivant et suivre les différentes étapes jusqu'à la fin. From 1e474e9ebdfd68cb4cfa03bb4905f919b0f17999 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 21 Sep 2016 15:20:56 +0200 Subject: [PATCH 2/5] Fixed: Unable to create shortcuts, see #279 --HG-- branch : develop --- .../client/ryzom_installer/src/utils.cpp | 22 +++++++++++++++++++ .../tools/client/ryzom_installer/src/utils.h | 9 ++++++++ 2 files changed, 31 insertions(+) diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index 28860ffab..fac7e7599 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -99,6 +99,8 @@ wchar_t* qToWide(const QString &str) bool createLink(const QString &link, const QString &name, const QString &executable, const QString &arguments, const QString &icon, const QString &workingDir) { + CCOMHelper comHelper; + IShellLinkW* psl; // Get a pointer to the IShellLink interface. It is assumed that CoInitialize @@ -135,6 +137,8 @@ bool createLink(const QString &link, const QString &name, const QString &executa bool resolveLink(const QWidget &window, const QString &linkFile, QString &path) { + CCOMHelper comHelper; + IShellLinkW* psl; WIN32_FIND_DATAW wfd; @@ -239,3 +243,21 @@ bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathOb } #endif + +CCOMHelper::CCOMHelper() +{ +#ifdef Q_OS_WIN + // to fix the bug with QFileDialog::getExistingDirectory hanging under Windows + m_mustUninit = SUCCEEDED(CoInitialize(NULL)); +#else + m_mustUninit = false; +#endif +} + +CCOMHelper::~CCOMHelper() +{ +#ifdef Q_OS_WIN + // only call CoUninitialize if CoInitialize succeeded + if (m_mustUninit) CoUninitialize(); +#endif +} diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.h b/code/ryzom/tools/client/ryzom_installer/src/utils.h index 6de89bcba..c016ed8ba 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.h +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.h @@ -51,4 +51,13 @@ wchar_t* qToWide(const QString &str); bool createLink(const QString &link, const QString &name, const QString &executable, const QString &arguments, const QString &icon, const QString &workingDir); bool resolveLink(const QWidget &window, const QString &pathLink, QString &pathObj); +class CCOMHelper +{ + bool m_mustUninit; + +public: + CCOMHelper(); + ~CCOMHelper(); +}; + #endif From f17e0c2dc10b4dcb587937c24e5c2081611053df Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 21 Sep 2016 15:21:26 +0200 Subject: [PATCH 3/5] Changed: Moved CCOMHelper to utils.h/cpp, see #279 --HG-- branch : develop --- .../tools/client/ryzom_installer/src/main.cpp | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index 3902296ec..c20b40efe 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -80,26 +80,6 @@ bool copyInstallerFiles(const QStringList &files, const QString &destination) return true; } -#ifdef Q_OS_WIN -class CCOMHelper -{ - bool m_mustUninit; - -public: - CCOMHelper() - { - // to fix the bug with QFileDialog::getExistingDirectory hanging under Windows - m_mustUninit = SUCCEEDED(CoInitialize(NULL)); - } - - ~CCOMHelper() - { - // only call CoUninitialize if CoInitialize succeeded - if (m_mustUninit) CoUninitialize(); - } -}; -#endif - int main(int argc, char *argv[]) { #if defined(_MSC_VER) && defined(_DEBUG) From f1a9a44028bab4763ebe461e5dc4114e80954174 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 21 Sep 2016 15:44:02 +0200 Subject: [PATCH 4/5] Fixed: Use translated size units, see #279 --HG-- branch : develop --- code/ryzom/tools/client/ryzom_installer/src/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp index fac7e7599..e2b26a7bb 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/utils.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/utils.cpp @@ -31,7 +31,7 @@ QString qBytesToHumanReadable(qint64 bytes) units.push_back(QObject::tr("PiB").toUtf8().constData()); } - return QString::fromUtf8(NLMISC::bytesToHumanReadable(bytes).c_str()); + return QString::fromUtf8(NLMISC::bytesToHumanReadableUnits(bytes, units).c_str()); } qint64 getDirectorySize(const QString &directory, bool recursize) From 7cf531c1a3b5eb7bec6f1a0f51bfb56aa6d90a29 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 21 Sep 2016 15:49:18 +0200 Subject: [PATCH 5/5] Changed: Delete ryzom_installer_uninstalling_old_client when old client is uninstalled, see #279 --HG-- branch : develop --- .../client/ryzom_installer/src/configfile.cpp | 16 +++++++++++++--- .../client/ryzom_installer/src/configfile.h | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index fea558af4..10ea322a2 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -466,7 +466,7 @@ bool CConfigFile::uninstallingOldClient() const return QFile::exists(getInstallationDirectory() + "/ryzom_installer_uninstalling_old_client"); } -void CConfigFile::setUninstallingOldClient(bool on) +void CConfigFile::setUninstallingOldClient(bool on) const { QString filename = getInstallationDirectory() + "/ryzom_installer_uninstalling_old_client"; @@ -999,9 +999,19 @@ OperationStep CConfigFile::getInstallNextStep() const if (!settings.contains("InstallLocation")) return CreateAddRemoveEntry; #endif - if (!uninstallingOldClient() && m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe")) + if (m_shouldUninstallOldClient && !getSrcServerDirectory().isEmpty()) { - return UninstallOldClient; + // if old client must be uninstalled + if (!uninstallingOldClient() && QFile::exists(getSrcServerDirectory() + "/Uninstall.exe")) + { + return UninstallOldClient; + } + + // if old client has been uninstalled + if (uninstallingOldClient() && !QFile::exists(getSrcServerDirectory() + "/Uninstall.exe")) + { + setUninstallingOldClient(false); + } } 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 ecad07af3..70ca6a6a0 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -112,7 +112,7 @@ public: void setShouldUninstallOldClient(bool on); bool uninstallingOldClient() const; - void setUninstallingOldClient(bool on); + void setUninstallingOldClient(bool on) const; QString expandVariables(const QString &str) const;