Show better error message when auto-updating fails

This commit is contained in:
pizzaboxer 2023-08-26 00:05:18 +01:00
parent af14c19334
commit cd0547664c
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -589,9 +589,10 @@ namespace Bloxstrap
return;
}
SetStatus($"Getting the latest {App.ProjectName}...");
try
{
// 64-bit is always the first option
GithubReleaseAsset asset = releaseInfo.Assets[0];
string downloadLocation = Path.Combine(Paths.LocalAppData, "Temp", asset.Name);
@ -623,6 +624,17 @@ namespace Bloxstrap
App.Terminate();
}
catch (Exception ex)
{
App.Logger.WriteLine(LOG_IDENT, "An exception occurred when running the auto-updater");
App.Logger.WriteException(LOG_IDENT, ex);
Controls.ShowMessageBox(
$"Bloxstrap was unable to auto-update to {releaseInfo.TagName}. Please update it manually by downloading and running the latest release from the GitHub page.",
MessageBoxImage.Information
);
}
}
private void Uninstall()
{