Fixed updater for good.
This commit is contained in:
parent
14e733c09a
commit
47d7b8431a
2 changed files with 10 additions and 11 deletions
|
@ -56,9 +56,7 @@ namespace Ryujinx.Updater
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine($"Updating Ryujinx... | {File.ReadAllText(Path.Combine(localAppPath, "Version.json"))} -> {args[1]}");
|
Console.WriteLine($"Updating Ryujinx...");
|
||||||
|
|
||||||
File.WriteAllText(Path.Combine(localAppPath, "Version.json"), args[1]);
|
|
||||||
|
|
||||||
// Create temp directory
|
// Create temp directory
|
||||||
|
|
||||||
|
|
|
@ -66,23 +66,24 @@ namespace Ryujinx
|
||||||
|
|
||||||
// Get Version.json to compare versions
|
// Get Version.json to compare versions
|
||||||
|
|
||||||
if (File.Exists(Path.Combine(localAppPath, "Version.json")))
|
if (File.Exists(Path.Combine(Environment.CurrentDirectory, "Version.json")))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string currentVersionJson;
|
string currentVersionJson;
|
||||||
string currentVersionBranch;
|
string currentVersionBranch;
|
||||||
string currentVersionPr;
|
string currentVersionPr;
|
||||||
var VersionJSON = JObject.Parse(Path.Combine(Environment.CurrentDirectory, "Version.json"));
|
|
||||||
var _JRoot = VersionJSON[0];
|
JObject VersionJSON = JObject.Parse(File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "Version.json")));
|
||||||
currentVersionJson = (string)_JRoot["BuildVer"];
|
|
||||||
currentVersionPr = (string)_JRoot["BuildPR"];
|
currentVersionJson = (string)VersionJSON["BuildVer"];
|
||||||
currentVersionBranch = (string)_JRoot["BuildBranch"];
|
currentVersionPr = (string)VersionJSON["BuildPR"];
|
||||||
|
currentVersionBranch = (string)VersionJSON["BuildBranch"];
|
||||||
|
|
||||||
Version newVersion = Version.Parse(_buildVer);
|
Version newVersion = Version.Parse(_buildVer);
|
||||||
Version currentVersion = Version.Parse(currentVersionJson);
|
Version currentVersion = Version.Parse(currentVersionJson);
|
||||||
|
|
||||||
if (newVersion.CompareTo(currentVersion) > 0)
|
if (newVersion < currentVersion)
|
||||||
{
|
{
|
||||||
GtkDialog.CreateInfoDialog("Update", "Ryujinx - Updater", "You are already using the most updated version of Ryujinx!", "");
|
GtkDialog.CreateInfoDialog("Update", "Ryujinx - Updater", "You are already using the most updated version of Ryujinx!", "");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue