Merge pull request #9580 from MetroidPrimeModding/redundant-update-trigger-check

[Updater] Check whether we've already had an update triggered
This commit is contained in:
Léo Lam 2021-03-16 10:19:54 +01:00 committed by GitHub
commit b980dd1385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,7 @@
namespace namespace
{ {
bool s_update_triggered = false;
#ifdef _WIN32 #ifdef _WIN32
const char UPDATER_FILENAME[] = "Updater.exe"; const char UPDATER_FILENAME[] = "Updater.exe";
@ -201,6 +202,14 @@ void AutoUpdateChecker::CheckForUpdate()
void AutoUpdateChecker::TriggerUpdate(const AutoUpdateChecker::NewVersionInformation& info, void AutoUpdateChecker::TriggerUpdate(const AutoUpdateChecker::NewVersionInformation& info,
AutoUpdateChecker::RestartMode restart_mode) AutoUpdateChecker::RestartMode restart_mode)
{ {
// Check to make sure we don't already have an update triggered
if (s_update_triggered)
{
WARN_LOG_FMT(COMMON, "Auto-update: received a redundant trigger request, ignoring");
return;
}
s_update_triggered = true;
#ifdef OS_SUPPORTS_UPDATER #ifdef OS_SUPPORTS_UPDATER
std::map<std::string, std::string> updater_flags; std::map<std::string, std::string> updater_flags;
updater_flags["this-manifest-url"] = info.this_manifest_url; updater_flags["this-manifest-url"] = info.this_manifest_url;