From 6d1e72c7481d1bfe393ed73f8c4997a2a2a15af8 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 26 Jun 2016 19:42:02 +0200 Subject: [PATCH] Changed: Only copy installer in TEMP if uninstalling --HG-- branch : develop --- .../tools/client/ryzom_installer/src/main.cpp | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index dfe588000..f46790110 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -61,23 +61,6 @@ int main(int argc, char *argv[]) QApplication::setApplicationVersion(RYZOM_VERSION); QApplication::setWindowIcon(QIcon(":/icons/ryzom.ico")); -#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(); // load application translations @@ -125,6 +108,23 @@ int main(int argc, char *argv[]) if (parser.isSet(uninstallOption)) { +#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 + SComponents components; // add all servers by default