Skip to content

Commit

Permalink
Launch updater when update is found (#799)
Browse files Browse the repository at this point in the history
Still required user confirmation, as before.
  • Loading branch information
coldino authored and cadon committed Nov 2, 2018
1 parent fb24e4b commit 39c492a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2206,9 +2206,21 @@ private void checkForUpdates(bool silentCheck = false)

if (localVersion.CompareTo(remoteVersion) < 0)
{
if (MessageBox.Show("A new version of ARK Smart Breeding is available.\nYou have " + localVersion.ToString() + ", available is " + remoteVersion.ToString() + ".\n\nDo you want to visit the homepage to check it out?", "New version available", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
if (MessageBox.Show($"A new version of ARK Smart Breeding is available.\nYou have {localVersion}, available is {remoteVersion}." +
"\n\nDo you want to download and install the update now?", "New version available",
MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
System.Diagnostics.Process.Start("https://github.com/cadon/ARKStatsExtractor/releases/latest");
// Ensure there are no unsaved changes
if (collectionDirty)
{
MessageBox.Show("Your Creature Collection has been modified since it was last saved. Please either save or discard your changes to proceed with the update.",
"Unsaved Changes", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}

// Launch the updater and exit the app
Process.Start(Path.Combine(Directory.GetCurrentDirectory(), "asb-updater.exe"));
Close();
return;
}
newToolVersionAvailable = true;
Expand Down

0 comments on commit 39c492a

Please sign in to comment.