Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Better way to check for new version.
Browse files Browse the repository at this point in the history
  • Loading branch information
alvr committed Sep 25, 2016
1 parent d11e16f commit 66dd395
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ASFui/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,16 @@ public static bool CheckIfAsfIsRunning()

public static void CheckVersion()
{
var assembly = System.Reflection.Assembly.GetExecutingAssembly();
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
var thisVersion = fvi.FileVersion;

string currentVersion;
using (var web = new WebClient())
{
currentVersion =
web.DownloadString("https://raw.githubusercontent.com/alvr/ASFui/master/version.txt");
}

if (new Version(thisVersion).CompareTo(new Version(currentVersion)) >= 0) return;
var option = MessageBox.Show(@"A new version is available, download now?", @"New version", MessageBoxButtons.YesNo,
if (new Version(Application.ProductVersion).CompareTo(new Version(currentVersion)) >= 0) return;
var option = MessageBox.Show(@"A new version (" + currentVersion + @") is available, download now?",
@"New version", MessageBoxButtons.YesNo,
MessageBoxIcon.Information);
if (option == DialogResult.Yes)
{
Expand Down

0 comments on commit 66dd395

Please sign in to comment.