From 7d909da4449e80a8e2eae4a1312d4bae44797c3d Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 5 Nov 2016 19:46:12 +0100 Subject: [PATCH] Changed: Rerun Installer from a specific directory with right arguments --- code/ryzom/tools/client/ryzom_installer/src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/main.cpp b/code/ryzom/tools/client/ryzom_installer/src/main.cpp index 499bd0198..ad95075e3 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/main.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/main.cpp @@ -98,6 +98,10 @@ int main(int argc, char *argv[]) QApplication::setApplicationVersion(RYZOM_VERSION); QApplication::setWindowIcon(QIcon(":/icons/ryzom.ico")); + // remove first argument because it's not really an argument + QStringList args = QApplication::arguments(); + args.removeFirst(); + QLocale locale = QLocale::system(); // load application translations @@ -199,7 +203,7 @@ int main(int argc, char *argv[]) nlinfo("Launching %s", Q2C(tempFile)); // launch copy in TEMP directory with same arguments - if (QProcess::startDetached(tempFile, QApplication::arguments())) return 0; + if (QProcess::startDetached(tempFile, args, tempPath)) return 0; nlwarning("Unable to launch %s", Q2C(tempFile)); } @@ -309,7 +313,7 @@ int main(int argc, char *argv[]) QFile::setPermissions(config.getInstallerInstalledFilePath(), QFile::permissions(config.getInstallerInstalledFilePath()) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther); #endif - if (QProcess::startDetached(config.getInstallerInstalledFilePath())) return 0; + if (QProcess::startDetached(config.getInstallerInstalledFilePath(), args, config.getInstallationDirectory())) return 0; nlwarning("Unable to restart Installer %s", Q2C(config.getInstallerInstalledFilePath())); #endif