diff --git a/src/UpdateInstaller.cpp b/src/UpdateInstaller.cpp index 888d2be..e649c27 100644 --- a/src/UpdateInstaller.cpp +++ b/src/UpdateInstaller.cpp @@ -412,20 +412,22 @@ void UpdateInstaller::restartMainApp() std::string command; std::list args; - for (std::vector::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::const_iterator iter = m_script->filesToInstall().begin(); + iter != m_script->filesToInstall().end(); + iter++) + { + if (iter->isMainBinary) + { + command = m_installDir + '/' + iter->path; + } + } + } if (!command.empty()) {