added execute arguments argument

This commit is contained in:
Jacker 2014-12-12 23:35:05 +02:00
parent 40c35f93cf
commit 1c4e9d87a7
5 changed files with 17 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
};

View File

@ -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");

View File

@ -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;

View File

@ -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)
{