Skip to content

Commit

Permalink
Fix version comparison bug (and bump to 2.0.1.0 to fix legacy versions)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Mar 14, 2016
1 parent 99af5c8 commit 765f9d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions ArchiSteamFarm/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ internal enum EMode : byte {
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; }
Expand Down Expand Up @@ -144,9 +144,11 @@ internal static async Task CheckForUpdate() {
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(
Expand Down
4 changes: 2 additions & 2 deletions ArchiSteamFarm/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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")]

0 comments on commit 765f9d2

Please sign in to comment.