feat: autoupdater

This commit is contained in:
2026-03-10 16:02:23 +01:00
parent f065f58f71
commit a7aad1a5ef
12 changed files with 507 additions and 72 deletions

View File

@@ -18,6 +18,7 @@ namespace CarManagerV3.Forms
InitializeComponent();
lblInstalledVersion.Text = lblInstalledVersion.Text.Replace("?.?.?", currentVersion);
lblLatestVersion.Text = lblLatestVersion.Text.Replace("?.?.?", latestVersion);
}
private void btnDismissUpdate_Click(object sender, EventArgs e)
@@ -25,9 +26,39 @@ namespace CarManagerV3.Forms
this.Close();
}
private async void btnInstallUpdate_Click(object sender, EventArgs e)
private void btnInstallUpdate_Click(object sender, EventArgs e)
{
Updater.DownloadNewestInstaller();
/*
var msgbox = new PleaseWait();
msgbox.Show();
Application.DoEvents();
StateManager.UpdateCar(car);
Image fooimg = ImageManager.GetImage(car);
msgbox.Close();
this.Close();
*/
PleaseWait loadForm = new PleaseWait("Downloading the newest version...");
try
{
this.Enabled = false;
loadForm.Show();
Application.DoEvents();
//return;
Updater.DownloadNewestInstaller();
}
catch (Exception ex)
{
MessageBox.Show("An error occurred while trying to download the update: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
this.Enabled = true;
loadForm.Close();
this.Close();
}
private void btnReadChangelog_Click(object sender, EventArgs e)
{
Updater.openReleasePage();
}
}
}