From ae56643f3a48e1dbfc5525bb84d0e1df87a62cac Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 17 Oct 2016 11:16:34 +0200 Subject: [PATCH] Changed: Use getInstallerCurrentFilePath() instead of QApplication::applicationFilePath() --- .../tools/client/ryzom_installer/src/configfile.cpp | 11 +++-------- .../tools/client/ryzom_installer/src/configfile.h | 1 - code/ryzom/tools/client/ryzom_installer/src/main.cpp | 2 +- .../client/ryzom_installer/src/migratedialog.cpp | 2 +- .../client/ryzom_installer/src/operationdialog.cpp | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 839c85272..2ff5abd05 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -492,11 +492,6 @@ QString CConfigFile::getParentDirectory() return current.absolutePath(); } -QString CConfigFile::getApplicationDirectory() -{ - return QApplication::applicationDirPath(); -} - QString CConfigFile::getOldInstallationDirectory() { // HKEY_CURRENT_USER/SOFTWARE/Nevrax/RyzomInstall/InstallId=1917716796 (string) @@ -818,7 +813,7 @@ QStringList CConfigFile::getInstallerRequiredFiles() const #endif // include current executable - files << QFileInfo(QApplication::applicationFilePath()).fileName(); + files << QFileInfo(getInstallerCurrentFilePath()).fileName(); #elif defined(Q_OS_MAC) // everything is in a directory files << "Ryzom Installer.app"; @@ -827,7 +822,7 @@ QStringList CConfigFile::getInstallerRequiredFiles() const files << "ryzom_installer.png"; // include current executable - files << QFileInfo(QApplication::applicationFilePath()).fileName(); + files << QFileInfo(getInstallerCurrentFilePath()).fileName(); #endif return files; @@ -875,7 +870,7 @@ OperationStep CConfigFile::getInstallNextStep() const if (!isRyzomInstalledIn(currentDirectory)) { // Ryzom is in the same directory as Ryzom Installer - currentDirectory = getApplicationDirectory(); + currentDirectory = getInstallerCurrentDirPath(); if (!isRyzomInstalledIn(currentDirectory)) { diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index a7b2a8919..1f71ad56b 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -90,7 +90,6 @@ public: // default directories static QString getCurrentDirectory(); static QString getParentDirectory(); - static QString getApplicationDirectory(); static QString getOldInstallationDirectory(); static QString getNewInstallationDirectory(); static QString getOldInstallationLanguage(); diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index 9b587c0b2..5e0bea7a9 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) // copy installer and required files to TEMP directory if (QDir().mkdir(tempPath) && copyInstallerFiles(config.getInstallerRequiredFiles(), tempPath)) { - QString tempFile = tempPath + "/" + QFileInfo(QApplication::applicationFilePath()).fileName(); + QString tempFile = tempPath + "/" + QFileInfo(getInstallerCurrentFilePath()).fileName(); // launch copy in TEMP directory with same arguments if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0; diff --git a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp index 2315d38ec..92c4da4e6 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/migratedialog.cpp @@ -38,7 +38,7 @@ CMigrateDialog::CMigrateDialog():QDialog() if (!CConfigFile::getInstance()->isRyzomInstalledIn(m_currentDirectory)) { // Ryzom is in the same directory as Ryzom Installer - m_currentDirectory = CConfigFile::getInstance()->getApplicationDirectory(); + m_currentDirectory = CConfigFile::getInstance()->getInstallerCurrentDirPath(); if (!CConfigFile::getInstance()->isRyzomInstalledIn(m_currentDirectory)) { diff --git a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp index 25bbd9b17..3b65152d3 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/operationdialog.cpp @@ -729,7 +729,7 @@ void COperationDialog::copyInstaller() // rename old client to installer - QString oldInstallerFullPath = QApplication::applicationFilePath(); + QString oldInstallerFullPath = config->getInstallerCurrentFilePath(); QString newInstallerFullPath = config->getInstallerInstalledFilePath(); if (!newInstallerFullPath.isEmpty())