mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2024-11-10 06:31:49 +00:00
added execute arguments argument
This commit is contained in:
parent
40c35f93cf
commit
1c4e9d87a7
5 changed files with 17 additions and 0 deletions
|
@ -415,6 +415,10 @@ void UpdateInstaller::restartMainApp()
|
||||||
if (!m_executable.empty())
|
if (!m_executable.empty())
|
||||||
{
|
{
|
||||||
command = m_installDir + '/' + m_executable;
|
command = m_installDir + '/' + m_executable;
|
||||||
|
if (!m_executable_args.empty())
|
||||||
|
{
|
||||||
|
args.push_front(m_executable_args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -471,3 +475,7 @@ void UpdateInstaller::setExecutable(std::string& bin)
|
||||||
m_executable = bin;
|
m_executable = bin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateInstaller::setExecutableArgs(std::string& args)
|
||||||
|
{
|
||||||
|
m_executable_args = args;
|
||||||
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ class UpdateInstaller
|
||||||
void setForceElevated(bool elevated);
|
void setForceElevated(bool elevated);
|
||||||
void setAutoClose(bool autoClose);
|
void setAutoClose(bool autoClose);
|
||||||
void setExecutable(std::string& bin);
|
void setExecutable(std::string& bin);
|
||||||
|
void setExecutableArgs(std::string& args);
|
||||||
|
|
||||||
void setObserver(UpdateObserver* observer);
|
void setObserver(UpdateObserver* observer);
|
||||||
|
|
||||||
|
@ -68,5 +69,6 @@ class UpdateInstaller
|
||||||
bool m_forceElevated;
|
bool m_forceElevated;
|
||||||
bool m_autoClose;
|
bool m_autoClose;
|
||||||
std::string m_executable;
|
std::string m_executable;
|
||||||
|
std::string m_executable_args;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -116,6 +116,7 @@ void UpdaterOptions::parse(int argc, char** argv)
|
||||||
parser.setOption("wait");
|
parser.setOption("wait");
|
||||||
parser.setOption("mode");
|
parser.setOption("mode");
|
||||||
parser.setOption("execute");
|
parser.setOption("execute");
|
||||||
|
parser.setOption("execute-args");
|
||||||
parser.setFlag("version");
|
parser.setFlag("version");
|
||||||
parser.setFlag("force-elevated");
|
parser.setFlag("force-elevated");
|
||||||
parser.setFlag("auto-close");
|
parser.setFlag("auto-close");
|
||||||
|
@ -146,6 +147,10 @@ void UpdaterOptions::parse(int argc, char** argv)
|
||||||
{
|
{
|
||||||
executable = parser.getValue("execute");
|
executable = parser.getValue("execute");
|
||||||
}
|
}
|
||||||
|
if (parser.getValue("execute-args"))
|
||||||
|
{
|
||||||
|
executable_args = parser.getValue("execute-args");
|
||||||
|
}
|
||||||
|
|
||||||
showVersion = parser.getFlag("version");
|
showVersion = parser.getFlag("version");
|
||||||
forceElevated = parser.getFlag("force-elevated");
|
forceElevated = parser.getFlag("force-elevated");
|
||||||
|
|
|
@ -15,6 +15,7 @@ class UpdaterOptions
|
||||||
std::string packageDir;
|
std::string packageDir;
|
||||||
std::string scriptPath;
|
std::string scriptPath;
|
||||||
std::string executable;
|
std::string executable;
|
||||||
|
std::string executable_args;
|
||||||
PLATFORM_PID waitPid;
|
PLATFORM_PID waitPid;
|
||||||
std::string logFile;
|
std::string logFile;
|
||||||
bool showVersion;
|
bool showVersion;
|
||||||
|
|
|
@ -147,6 +147,7 @@ int main(int argc, char** argv)
|
||||||
installer.setForceElevated(options.forceElevated);
|
installer.setForceElevated(options.forceElevated);
|
||||||
installer.setAutoClose(options.autoClose);
|
installer.setAutoClose(options.autoClose);
|
||||||
installer.setExecutable(options.executable);
|
installer.setExecutable(options.executable);
|
||||||
|
installer.setExecutableArgs(options.executable_args);
|
||||||
|
|
||||||
if (options.mode == UpdateInstaller::Main)
|
if (options.mode == UpdateInstaller::Main)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue