Provide more info if the launcher update fails (#214)

Also prevents the launcher from bricking itself (again)

---

By creating this pull request, I understand that code that is AI
generated or otherwise automatically generated may be rejected without
further discussion.
I declare that I fully understand all code I pushed into this PR, and
wrote all this code myself and own the rights to this code.
This commit is contained in:
Tixx
2025-11-22 20:09:15 +01:00
committed by GitHub
+5 -2
View File
@@ -211,11 +211,11 @@ void CheckForUpdates(const std::string& CV) {
error("Auto update is NOT implemented for the Linux version. Please update manually ASAP as updates contain security patches.");
#else
info("Downloading Launcher update " + LatestHash);
HTTP::Download(
if (HTTP::Download(
"https://backend.beammp.com/builds/launcher?download=true"
"&pk="
+ PublicKey + "&branch=" + Branch,
GetBP() / (beammp_wide("new_") + GetEN()), LatestHash);
GetBP() / (beammp_wide("new_") + GetEN()), LatestHash)) {
std::error_code ec;
fs::remove(Back, ec);
if (ec == std::errc::permission_denied) {
@@ -226,6 +226,9 @@ void CheckForUpdates(const std::string& CV) {
}
fs::rename(GetBP() / (beammp_wide("new_") + GetEN()), BP);
URelaunch();
} else {
throw std::runtime_error("Failed to download the launcher update! Please try manually updating it, https://docs.beammp.com/FAQ/Update-launcher/");
}
#endif
} else {
warn("Launcher update was found, but not updating because --no-update or --dev was specified.");