summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/AutoUpdate.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2018-03-23 00:29:03 +0100
committerPierre Bourdon <delroth@gmail.com>2018-03-23 11:10:25 +0100
commit9628333b864aa517a4a22dfe1b162c49ef23adf1 (patch)
treec0d322d7a8eee5fedb33e712a6762eec5d15af80 /Source/Core/UICommon/AutoUpdate.cpp
parent773ec975f398d19b38b2cf6caf345bf9e80b902c (diff)
AutoUpdater: support optionally restarting Dolphin after update
Diffstat (limited to 'Source/Core/UICommon/AutoUpdate.cpp')
-rw-r--r--Source/Core/UICommon/AutoUpdate.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/UICommon/AutoUpdate.cpp b/Source/Core/UICommon/AutoUpdate.cpp
index dc094f29ac..916176faaf 100644
--- a/Source/Core/UICommon/AutoUpdate.cpp
+++ b/Source/Core/UICommon/AutoUpdate.cpp
@@ -111,7 +111,8 @@ void AutoUpdateChecker::CheckForUpdate()
OnUpdateAvailable(nvi);
}
-void AutoUpdateChecker::TriggerUpdate(const AutoUpdateChecker::NewVersionInformation& info)
+void AutoUpdateChecker::TriggerUpdate(const AutoUpdateChecker::NewVersionInformation& info,
+ AutoUpdateChecker::RestartMode restart_mode)
{
#ifdef _WIN32
std::map<std::string, std::string> updater_flags;
@@ -122,6 +123,9 @@ void AutoUpdateChecker::TriggerUpdate(const AutoUpdateChecker::NewVersionInforma
updater_flags["install-base-path"] = File::GetExeDirectory();
updater_flags["log-file"] = File::GetExeDirectory() + DIR_SEP + UPDATER_LOG_FILE;
+ if (restart_mode == RestartMode::RESTART_AFTER_UPDATE)
+ updater_flags["binary-to-restart"] = File::GetExePath();
+
// Copy the updater so it can update itself if needed.
std::string updater_path = File::GetExeDirectory() + DIR_SEP + UPDATER_FILENAME;
std::string reloc_updater_path = File::GetExeDirectory() + DIR_SEP + UPDATER_RELOC_FILENAME;