Modified the update logic

This commit is contained in:
Ashley 2020-02-06 14:55:26 -05:00
commit a1360f9d9a
3 changed files with 7 additions and 5 deletions

View file

@ -56,8 +56,6 @@ namespace Ryujinx.Updater
return; return;
} }
//Write version comparison logic here
Console.WriteLine($"Updating Ryujinx... | {File.ReadAllText(Path.Combine(localAppPath, "Version.json"))} -> {args[1]}"); Console.WriteLine($"Updating Ryujinx... | {File.ReadAllText(Path.Combine(localAppPath, "Version.json"))} -> {args[1]}");
File.WriteAllText(Path.Combine(localAppPath, "Version.json"), args[1]); File.WriteAllText(Path.Combine(localAppPath, "Version.json"), args[1]);

View file

@ -70,9 +70,12 @@ namespace Ryujinx
{ {
try try
{ {
Version newVersion = Version.Parse(_buildVer); 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"];
string currentVersionJson = File.ReadAllLines(Path.Combine(localAppPath, "Version.json"))[0]; Version newVersion = Version.Parse(_buildVer);
Version currentVersion = Version.Parse(currentVersionJson); Version currentVersion = Version.Parse(currentVersionJson);
if (newVersion.CompareTo(currentVersion) == 0) if (newVersion.CompareTo(currentVersion) == 0)

View file

@ -1,4 +1,5 @@
{ {
"BuildVer":"_ver", "BuildVer":"_ver",
"BuildCommit":"_commit" "BuildPr":"_pr",
"BuildBranch":"_branch"
} }