feat: autoupdater
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user