diff --git a/src/UpdateInstaller.cpp b/src/UpdateInstaller.cpp index e649c27..cd10b4b 100644 --- a/src/UpdateInstaller.cpp +++ b/src/UpdateInstaller.cpp @@ -415,6 +415,10 @@ void UpdateInstaller::restartMainApp() if (!m_executable.empty()) { command = m_installDir + '/' + m_executable; + if (!m_executable_args.empty()) + { + args.push_front(m_executable_args); + } } else { @@ -471,3 +475,7 @@ void UpdateInstaller::setExecutable(std::string& bin) m_executable = bin; } +void UpdateInstaller::setExecutableArgs(std::string& args) +{ + m_executable_args = args; +} diff --git a/src/UpdateInstaller.h b/src/UpdateInstaller.h index 652e1c3..a9ca25d 100644 --- a/src/UpdateInstaller.h +++ b/src/UpdateInstaller.h @@ -34,6 +34,7 @@ class UpdateInstaller void setForceElevated(bool elevated); void setAutoClose(bool autoClose); void setExecutable(std::string& bin); + void setExecutableArgs(std::string& args); void setObserver(UpdateObserver* observer); @@ -68,5 +69,6 @@ class UpdateInstaller bool m_forceElevated; bool m_autoClose; std::string m_executable; + std::string m_executable_args; }; diff --git a/src/UpdaterOptions.cpp b/src/UpdaterOptions.cpp index ad3fa4d..4691abb 100644 --- a/src/UpdaterOptions.cpp +++ b/src/UpdaterOptions.cpp @@ -116,6 +116,7 @@ void UpdaterOptions::parse(int argc, char** argv) parser.setOption("wait"); parser.setOption("mode"); parser.setOption("execute"); + parser.setOption("execute-args"); parser.setFlag("version"); parser.setFlag("force-elevated"); parser.setFlag("auto-close"); @@ -146,6 +147,10 @@ void UpdaterOptions::parse(int argc, char** argv) { executable = parser.getValue("execute"); } + if (parser.getValue("execute-args")) + { + executable_args = parser.getValue("execute-args"); + } showVersion = parser.getFlag("version"); forceElevated = parser.getFlag("force-elevated"); diff --git a/src/UpdaterOptions.h b/src/UpdaterOptions.h index 997dd4c..4e23d53 100644 --- a/src/UpdaterOptions.h +++ b/src/UpdaterOptions.h @@ -15,6 +15,7 @@ class UpdaterOptions std::string packageDir; std::string scriptPath; std::string executable; + std::string executable_args; PLATFORM_PID waitPid; std::string logFile; bool showVersion; diff --git a/src/main.cpp b/src/main.cpp index f968b7a..1a2870e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -147,6 +147,7 @@ int main(int argc, char** argv) installer.setForceElevated(options.forceElevated); installer.setAutoClose(options.autoClose); installer.setExecutable(options.executable); + installer.setExecutableArgs(options.executable_args); if (options.mode == UpdateInstaller::Main) {