From 8538f2f46f4234407070f8d093ae92e25bde756e Mon Sep 17 00:00:00 2001 From: DrHacknik Date: Thu, 23 Jan 2020 13:35:03 -0500 Subject: [PATCH] Added some comments - Also changed some catch exceptions --- Ryujinx/Updater/Parser/UpdateParser.cs | 22 +++++++++++++--------- Ryujinx/Updater/Update.cs | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Ryujinx/Updater/Parser/UpdateParser.cs b/Ryujinx/Updater/Parser/UpdateParser.cs index a940ea8f7c..1181e977da 100644 --- a/Ryujinx/Updater/Parser/UpdateParser.cs +++ b/Ryujinx/Updater/Parser/UpdateParser.cs @@ -42,6 +42,7 @@ namespace Ryujinx.Updater.Parser else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) _PlatformExt = "linux_x64.tar.gz"; + //Begin the Appveyor parsing WebClient JSONClient = new WebClient(); string FetchedJSON = JSONClient.DownloadString(_BuildURL); var __JSONRoot = JObject.Parse(FetchedJSON); @@ -74,19 +75,20 @@ namespace Ryujinx.Updater.Parser GtkDialog.CreateErrorDialog("Update canceled by user or failed to grab or parse the information.\nPlease try at a later time, or report the error to our GitHub."); return; } - UpdateData data = new UpdateData() - { - JobID = _JobID, - BuildVer = _BuildVer, - BuildURL = _BuildURL, - BuildArt = _BuildArt, - BuildCommit = _BuildCommit, - Branch = _Branch - }; + //UpdateData data = new UpdateData() + //{ + // JobID = _JobID, + // BuildVer = _BuildVer, + // BuildURL = _BuildURL, + // BuildArt = _BuildArt, + // BuildCommit = _BuildCommit, + // Branch = _Branch + //}; } private static async void GrabPackage() { + //Check if paths exist if (!Directory.Exists(Path.Combine(_RyuDir, "Data", "Update")) || !Directory.Exists(Path.Combine(_RyuDir, "Data")) || !Directory.Exists(Path.Combine(Environment.CurrentDirectory, "temp"))) { Directory.CreateDirectory(Path.Combine(_RyuDir, "Data", "Update")); @@ -96,6 +98,7 @@ namespace Ryujinx.Updater.Parser try { + //Attempt to grab the latest package _Package.DownloadProgressChanged += new DownloadProgressChangedEventHandler(PackageDownloadProgress); _Package.DownloadFileCompleted += new AsyncCompletedEventHandler(PackageDownloadedAsync); using (MessageDialog dialog = GtkDialog.CreateProgressDialog("Update", "Ryujinx - Update", "Downloading update " + _BuildVer, "Please wait while we download the latest package and extract it.")) @@ -134,6 +137,7 @@ namespace Ryujinx.Updater.Parser { try { + //Begin the extaction process using (Ionic.Zip.ZipFile Package = Ionic.Zip.ZipFile.Read(Path.Combine(_RyuDir, "Data", "Update", "RyujinxPackage.zip"))) { await Task.Run(() => Package.ExtractAll(Path.Combine(Environment.CurrentDirectory,"temp"), ExtractExistingFileAction.OverwriteSilently)); diff --git a/Ryujinx/Updater/Update.cs b/Ryujinx/Updater/Update.cs index 9dae4fd3e2..ed067f15b9 100644 --- a/Ryujinx/Updater/Update.cs +++ b/Ryujinx/Updater/Update.cs @@ -18,6 +18,7 @@ namespace Ryujinx.Updater { try { + //Get list of files from the current directory, and copy them to the parent directory. foreach (string _PathDir in Directory.GetDirectories(RyuDir, "*", SearchOption.AllDirectories)) Directory.CreateDirectory(_PathDir.Replace(RyuDir, ParentDir)); @@ -40,7 +41,6 @@ namespace Ryujinx.Updater } catch (System.ComponentModel.Win32Exception) { - //Logger.PrintError(LogClass.Application, "Package installation has failed\n" + ex.InnerException.ToString()); GtkDialog.CreateErrorDialog("Package installation has failed\nCheck the log for more information."); return; }