Fix launcher update to delete backup after download

This commit is contained in:
Tixx 2025-07-17 14:32:17 +02:00
parent e7cfb6e406
commit e6e5bf8327
No known key found for this signature in database
GPG Key ID: EC6E7A2BAABF0B8C

View File

@ -179,14 +179,15 @@ void CheckForUpdates(const std::string& CV) {
#if defined(__linux__)
error("Auto update is NOT implemented for the Linux version. Please update manually ASAP as updates contain security patches.");
#else
fs::remove(Back);
fs::rename(EP, Back);
info("Downloading Launcher update " + LatestHash);
HTTP::Download(
"https://backend.beammp.com/builds/launcher?download=true"
"&pk="
+ PublicKey + "&branch=" + Branch,
EP);
beammp_wide("new_") + EP);
fs::remove(Back, ec);
fs::rename(EP, Back);
fs::rename(beammp_wide("new_") + EP, EP);
URelaunch();
#endif
} else {