From 10557b5512523f8e074828a441550671ad7f929e Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 21 Sep 2016 15:49:18 +0200 Subject: [PATCH] Changed: Delete ryzom_installer_uninstalling_old_client when old client is uninstalled, see #279 --- .../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;