From 66dd3950f8025951f571ae042a1fca6b8746934c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20S?= Date: Sun, 25 Sep 2016 22:12:43 +0200 Subject: [PATCH] Better way to check for new version. --- ASFui/Util.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ASFui/Util.cs b/ASFui/Util.cs index 8d48f7b..ce9a311 100644 --- a/ASFui/Util.cs +++ b/ASFui/Util.cs @@ -60,10 +60,6 @@ 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()) { @@ -71,8 +67,9 @@ public static void CheckVersion() 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) {