feat: autoupdater
This commit is contained in:
@@ -61,11 +61,17 @@ namespace CarManagerV3
|
||||
}
|
||||
|
||||
refreshRecents();
|
||||
|
||||
if (Updater.IsUpdateAvailable(Properties.Settings.Default.AllowPrerelease))
|
||||
try
|
||||
{
|
||||
UpdatePromptForm updatePrompt = new UpdatePromptForm(Updater.GetCurrentVersion(), Updater.GetLatestVersion());
|
||||
updatePrompt.ShowDialog();
|
||||
if (Updater.IsUpdateAvailable(Properties.Settings.Default.AllowPrerelease))
|
||||
{
|
||||
UpdatePromptForm updatePrompt = new UpdatePromptForm(Updater.GetCurrentVersion(), Updater.GetLatestVersion());
|
||||
updatePrompt.ShowDialog();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Error.WriteLine("Error checking for updates: " + ex.Message);
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +156,7 @@ namespace CarManagerV3
|
||||
Console.WriteLine($"[L] Updating car: {car.Id}");
|
||||
// changes
|
||||
card = existing;
|
||||
if(force) card.LoadImage(); // reload image if forced refresh
|
||||
if (force) card.LoadImage(); // reload image if forced refresh
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -558,5 +564,35 @@ namespace CarManagerV3
|
||||
settingsForm.ShowDialog();
|
||||
|
||||
}
|
||||
|
||||
private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Updater.IsUpdateAvailable(Properties.Settings.Default.AllowPrerelease))
|
||||
{
|
||||
UpdatePromptForm updatePrompt = new UpdatePromptForm(Updater.GetCurrentVersion(), Updater.GetLatestVersion());
|
||||
updatePrompt.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show($"You are already using the latest version. ({Updater.GetCurrentVersion()})", "No Updates Available", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error checking for updates: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void gitRepositoryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Open the Git repository in the user's default browser
|
||||
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
|
||||
{
|
||||
FileName = "https://git.jaro.digital/frozd/carmanager-3",
|
||||
UseShellExecute = true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user