added execute command so that we can start the main binary even if it was not updated, also added legacy branding

This commit is contained in:
jackeri 2014-12-12 10:32:06 +02:00
parent 9b72b1ad18
commit a60da9122b
6 changed files with 22 additions and 4 deletions

View file

@ -17,7 +17,7 @@ std::string AppInfo::updateErrorMessage(const std::string& details)
std::string result = "There was a problem installing the update:\n\n";
result += details;
result += "\n\nYou can try downloading and installing the latest version of "
"Mendeley Desktop from http://www.mendeley.com/download-mendeley-desktop";
"ET:Legacy from http://www.etlegacy.com/";
return result;
}

View file

@ -24,16 +24,16 @@ class AppInfo
inline std::string AppInfo::name()
{
return "Mendeley Updater";
return "Legacy Updater";
}
inline std::string AppInfo::appName()
{
return "Mendeley Desktop";
return "ET:Legacy";
}
inline std::string AppInfo::organizationName()
{
return "Mendeley Ltd.";
return "Legacy Team.";
}

View file

@ -422,6 +422,11 @@ void UpdateInstaller::restartMainApp()
}
}
if (command.empty() && !m_executable.empty())
{
command = m_installDir + '/' + m_executable;
}
if (!command.empty())
{
LOG(Info,"Starting main application " + command);
@ -459,3 +464,8 @@ void UpdateInstaller::setAutoClose(bool autoClose)
m_autoClose = autoClose;
}
void UpdateInstaller::setExecutable(std::string& bin)
{
m_executable = bin;
}

View file

@ -33,6 +33,7 @@ class UpdateInstaller
void setWaitPid(PLATFORM_PID pid);
void setForceElevated(bool elevated);
void setAutoClose(bool autoClose);
void setExecutable(std::string& bin);
void setObserver(UpdateObserver* observer);
@ -66,5 +67,6 @@ class UpdateInstaller
std::map<std::string,std::string> m_backups;
bool m_forceElevated;
bool m_autoClose;
std::string m_executable;
};

View file

@ -115,6 +115,7 @@ void UpdaterOptions::parse(int argc, char** argv)
parser.setOption("script");
parser.setOption("wait");
parser.setOption("mode");
parser.setOption("execute");
parser.setFlag("version");
parser.setFlag("force-elevated");
parser.setFlag("auto-close");
@ -141,6 +142,10 @@ void UpdaterOptions::parse(int argc, char** argv)
{
waitPid = static_cast<PLATFORM_PID>(atoll(parser.getValue("wait")));
}
if (parser.getValue("execute"))
{
executable = parser.getValue("execute");
}
showVersion = parser.getFlag("version");
forceElevated = parser.getFlag("force-elevated");

View file

@ -14,6 +14,7 @@ class UpdaterOptions
std::string installDir;
std::string packageDir;
std::string scriptPath;
std::string executable;
PLATFORM_PID waitPid;
std::string logFile;
bool showVersion;