diff --git a/Procurement/ApplicationState.cs b/Procurement/ApplicationState.cs index f15ed721..0a1438be 100644 --- a/Procurement/ApplicationState.cs +++ b/Procurement/ApplicationState.cs @@ -10,6 +10,10 @@ namespace Procurement { public static class ApplicationState { + /// + /// Application version to check for latest release. + /// Must begin with "Procurement ". See: VersionChecker.cs + /// public static string Version = "Procurement 1.14.0"; public static POEModel Model = new POEModel(); public static Dictionary Stash = new Dictionary(); diff --git a/Procurement/Utility/VersionChecker.cs b/Procurement/Utility/VersionChecker.cs index 4343d7e1..4f80f13d 100644 --- a/Procurement/Utility/VersionChecker.cs +++ b/Procurement/Utility/VersionChecker.cs @@ -44,8 +44,9 @@ private static void client_DownloadStringCompleted(object sender, DownloadString string[] updateInfo = e.Result.Split(','); updateInfo[0] = updateInfo[0].Replace("Procurement ", ""); - Version currentVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; - Version latestVersion = new Version(updateInfo[0]); + var appVersion = ApplicationState.Version.Replace("Procurement ", ""); + var currentVersion = new Version(appVersion); + var latestVersion = new Version(updateInfo[0]); if (currentVersion >= latestVersion || MessageBox.Show("A new version of Procurement is available! Would you like to download now? (Opens in browser)", "Update Available", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) return;