From 40c35f93cfc3fb8a6f2f9f77461217fe1db51371 Mon Sep 17 00:00:00 2001 From: jackeri Date: Fri, 12 Dec 2014 14:43:57 +0200 Subject: [PATCH] setting executable overwrites the script values --- src/UpdateInstaller.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) 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()) {