diff --git a/Ryujinx/Ryujinx.csproj b/Ryujinx/Ryujinx.csproj
index bde01b243e..7c5b925f05 100644
--- a/Ryujinx/Ryujinx.csproj
+++ b/Ryujinx/Ryujinx.csproj
@@ -37,6 +37,7 @@
+
@@ -58,6 +59,7 @@
+
diff --git a/Ryujinx/Ui/GtkDialog.cs b/Ryujinx/Ui/GtkDialog.cs
index b4e9fa1caa..4d43299bdf 100644
--- a/Ryujinx/Ui/GtkDialog.cs
+++ b/Ryujinx/Ui/GtkDialog.cs
@@ -1,5 +1,8 @@
using Gtk;
using System.Reflection;
+using Ryujinx.Updater.Parser;
+using System.IO;
+using System;
namespace Ryujinx.Ui
{
@@ -29,5 +32,56 @@ namespace Ryujinx.Ui
{
CreateDialog("Ryujinx - Error", "Ryujinx has encountered an error", errorMessage);
}
+
+ internal static MessageDialog CreateAcceptDialog(string iconType, string acceptMessage)
+ {
+ MessageDialog messageDialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, null)
+ {
+ Title = "Ryujinx - Update",
+ Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Update.png"),
+ Text = "Would you like to update?",
+ SecondaryText = "Version " + acceptMessage + " is available.",
+ WindowPosition = WindowPosition.Center
+ };
+ messageDialog.SetSizeRequest(100, 20);
+ return messageDialog;
+ }
+
+ internal static MessageDialog CreateInfoDialog(string iconType, string titleMessage, string textMessage, string secText)
+ {
+ MessageDialog messageDialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, null)
+ {
+ Title = titleMessage,
+ Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets." + iconType +".png"),
+ Text = textMessage,
+ SecondaryText = secText,
+ WindowPosition = WindowPosition.Center
+ };
+ messageDialog.SetSizeRequest(100, 20);
+ return messageDialog;
+ }
+
+ internal static async System.Threading.Tasks.Task CreateProgressDialogAsync(bool isInstall, string iconType, string titleMessage, string textMessage, string secText)
+ {
+ MessageDialog messageDialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.None, null)
+ {
+ Title = titleMessage,
+ Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets." + iconType + ".png"),
+ Text = textMessage,
+ SecondaryText = secText,
+ WindowPosition = WindowPosition.Center
+ };
+ messageDialog.SetSizeRequest(100, 20);
+ if (isInstall == true)
+ {
+ await UpdateParser.ExtractPackageAsync();
+ }
+ else
+ {
+ Uri URL = new Uri(UpdateParser._BuildArt);
+ UpdateParser._Package.DownloadFileAsync(URL, Path.Combine(UpdateParser._RyuDir, "Data", "Update", "RyujinxPackage.zip"));
+ }
+ return messageDialog;
+ }
}
}
diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs
index 6c771bb96f..aae63d9cd2 100644
--- a/Ryujinx/Ui/MainWindow.cs
+++ b/Ryujinx/Ui/MainWindow.cs
@@ -896,16 +896,18 @@ namespace Ryujinx.Ui
private void Update_Pressed(object sender, EventArgs args)
{
- string ryuUpdater = System.IO.Path.Combine(_virtualFileSystem.GetBasePath(), "RyuUpdater.exe");
+ Ryujinx.Updater.Parser.UpdateParser.BeginParse();
+ return;
+ //string ryuUpdater = System.IO.Path.Combine(new VirtualFileSystem().GetBasePath(), "RyuUpdater.exe");
- try
- {
- Process.Start(new ProcessStartInfo(ryuUpdater, "/U") { UseShellExecute = true });
- }
- catch(System.ComponentModel.Win32Exception)
- {
- GtkDialog.CreateErrorDialog("Update canceled by user or updater was not found");
- }
+ //try
+ //{
+ // Process.Start(new ProcessStartInfo(ryuUpdater, "/U") { UseShellExecute = true });
+ //}
+ //catch(System.ComponentModel.Win32Exception)
+ //{
+ // GtkDialog.CreateErrorDialog("Update canceled by user or updater was not found");
+ //}
}
private void About_Pressed(object sender, EventArgs args)
diff --git a/Ryujinx/Ui/MainWindow.glade b/Ryujinx/Ui/MainWindow.glade
index 8477f392a4..a2b1165071 100644
--- a/Ryujinx/Ui/MainWindow.glade
+++ b/Ryujinx/Ui/MainWindow.glade
@@ -323,7 +323,7 @@