From 765f9d29bbb7a4e6b185756d3941e2a34abfdcea Mon Sep 17 00:00:00 2001 From: JustArchi Date: Mon, 14 Mar 2016 22:40:19 +0100 Subject: [PATCH] Fix version comparison bug (and bump to 2.0.1.0 to fix legacy versions) --- ArchiSteamFarm/Program.cs | 8 +++++--- ArchiSteamFarm/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ArchiSteamFarm/Program.cs b/ArchiSteamFarm/Program.cs index 932c06013..157bfcc06 100644 --- a/ArchiSteamFarm/Program.cs +++ b/ArchiSteamFarm/Program.cs @@ -72,7 +72,7 @@ namespace ArchiSteamFarm { private static readonly string ExecutableDirectory = Path.GetDirectoryName(ExecutableFile); private static readonly WCF WCF = new WCF(); - internal static readonly string Version = Assembly.GetName().Version.ToString(); + internal static readonly Version Version = Assembly.GetName().Version; internal static GlobalConfig GlobalConfig { get; private set; } internal static GlobalDatabase GlobalDatabase { get; private set; } @@ -144,9 +144,11 @@ namespace ArchiSteamFarm { return; } - Logging.LogGenericInfo("Local version: " + Version + " | Remote version: " + releaseResponse.Tag); + Version newVersion = new Version(releaseResponse.Tag); - if (string.Compare(Version, releaseResponse.Tag, StringComparison.Ordinal) >= 0) { // If local version is the same or newer than remote version + Logging.LogGenericInfo("Local version: " + Version + " | Remote version: " + newVersion); + + if (Version.CompareTo(newVersion) >= 0) { // If local version is the same or newer than remote version if (GlobalConfig.AutoUpdates && AutoUpdatesTimer == null) { Logging.LogGenericInfo("ASF will automatically check for new versions every 24 hours"); AutoUpdatesTimer = new Timer( diff --git a/ArchiSteamFarm/Properties/AssemblyInfo.cs b/ArchiSteamFarm/Properties/AssemblyInfo.cs index 064ffacd7..7abcebb32 100644 --- a/ArchiSteamFarm/Properties/AssemblyInfo.cs +++ b/ArchiSteamFarm/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.0.11")] -[assembly: AssemblyFileVersion("2.0.0.11")] +[assembly: AssemblyVersion("2.0.1.0")] +[assembly: AssemblyFileVersion("2.0.1.0")]