From 7466be80657ba85ce4aa785ca80a72599949500f Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 6 Feb 2020 14:55:26 -0500 Subject: [PATCH] Modified the update logic --- Ryujinx.Updater/Program.cs | 2 -- Ryujinx/Updater/UpdateParser.cs | 7 +++++-- Version.json | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Ryujinx.Updater/Program.cs b/Ryujinx.Updater/Program.cs index b39d2a14d3..789c58cbd5 100644 --- a/Ryujinx.Updater/Program.cs +++ b/Ryujinx.Updater/Program.cs @@ -56,8 +56,6 @@ namespace Ryujinx.Updater return; } - //Write version comparison logic here - Console.WriteLine($"Updating Ryujinx... | {File.ReadAllText(Path.Combine(localAppPath, "Version.json"))} -> {args[1]}"); File.WriteAllText(Path.Combine(localAppPath, "Version.json"), args[1]); diff --git a/Ryujinx/Updater/UpdateParser.cs b/Ryujinx/Updater/UpdateParser.cs index 1bef55bd4f..d0fc3f6334 100644 --- a/Ryujinx/Updater/UpdateParser.cs +++ b/Ryujinx/Updater/UpdateParser.cs @@ -70,9 +70,12 @@ namespace Ryujinx { try { + var VersionJSON = JObject.Parse(Path.Combine(Environment.CurrentDirectory, "Version.json")); + (string)currentVersionJson = (string)_VersionJSON["BuildVer"]; + (string)currentVersionPr = (string)_VersionJSON["BuildPR"]; + (string)currentVersionBranch = (string)_VersionJSON["BuildBranch"]; + Version newVersion = Version.Parse(_buildVer); - - string currentVersionJson = File.ReadAllLines(Path.Combine(localAppPath, "Version.json"))[0]; Version currentVersion = Version.Parse(currentVersionJson); if (newVersion.CompareTo(currentVersion) == 0) diff --git a/Version.json b/Version.json index 89febf0ee4..ec5ad6c4b1 100644 --- a/Version.json +++ b/Version.json @@ -1,4 +1,5 @@ { "BuildVer":"_ver", - "BuildCommit":"_commit" + "BuildPr":"_pr", + "BuildBranch":"_branch" } \ No newline at end of file