setting executable overwrites the script values

This commit is contained in:
jackeri 2014-12-12 14:43:57 +02:00
parent 89bb4b2edc
commit 40c35f93cf
1 changed files with 13 additions and 11 deletions

View File

@ -412,20 +412,22 @@ void UpdateInstaller::restartMainApp()
std::string command;
std::list<std::string> args;
for (std::vector<UpdateScriptFile>::const_iterator iter = m_script->filesToInstall().begin();
iter != m_script->filesToInstall().end();
iter++)
{
if (iter->isMainBinary)
{
command = m_installDir + '/' + iter->path;
}
}
if (command.empty() && !m_executable.empty())
if (!m_executable.empty())
{
command = m_installDir + '/' + m_executable;
}
else
{
for (std::vector<UpdateScriptFile>::const_iterator iter = m_script->filesToInstall().begin();
iter != m_script->filesToInstall().end();
iter++)
{
if (iter->isMainBinary)
{
command = m_installDir + '/' + iter->path;
}
}
}
if (!command.empty())
{