diff --git a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs
index ae3fa4937f..cab38046e2 100644
--- a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs
+++ b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs
@@ -14,7 +14,7 @@ namespace Ryujinx.Configuration
///
/// The current version of the file format
///
- public const int CurrentVersion = 12;
+ public const int CurrentVersion = 14;
public int Version { get; set; }
@@ -118,6 +118,11 @@ namespace Ryujinx.Configuration
///
public bool EnableDiscordIntegration { get; set; }
+ ///
+ /// Checks for updates when Ryujinx starts when enabled
+ ///
+ public bool CheckUpdatesOnStart { get; set; }
+
///
/// Enables or disables Vertical Sync
///
diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs
index 7f79dd6e13..df07019dcb 100644
--- a/Ryujinx.Common/Configuration/ConfigurationState.cs
+++ b/Ryujinx.Common/Configuration/ConfigurationState.cs
@@ -343,6 +343,11 @@ namespace Ryujinx.Configuration
///
public ReactiveObject EnableDiscordIntegration { get; private set; }
+ ///
+ /// Checks for updates when Ryujinx starts when enabled
+ ///
+ public ReactiveObject CheckUpdatesOnStart { get; private set; }
+
private ConfigurationState()
{
Ui = new UiSection();
@@ -351,6 +356,7 @@ namespace Ryujinx.Configuration
Graphics = new GraphicsSection();
Hid = new HidSection();
EnableDiscordIntegration = new ReactiveObject();
+ CheckUpdatesOnStart = new ReactiveObject();
}
public ConfigurationFileFormat ToFileFormat()
@@ -393,6 +399,7 @@ namespace Ryujinx.Configuration
SystemTimeOffset = System.SystemTimeOffset,
DockedMode = System.EnableDockedMode,
EnableDiscordIntegration = EnableDiscordIntegration,
+ CheckUpdatesOnStart = CheckUpdatesOnStart,
EnableVsync = Graphics.EnableVsync,
EnableMulticoreScheduling = System.EnableMulticoreScheduling,
EnablePtc = System.EnablePtc,
@@ -452,6 +459,7 @@ namespace Ryujinx.Configuration
System.SystemTimeOffset.Value = 0;
System.EnableDockedMode.Value = false;
EnableDiscordIntegration.Value = true;
+ CheckUpdatesOnStart.Value = true;
Graphics.EnableVsync.Value = true;
System.EnableMulticoreScheduling.Value = true;
System.EnablePtc.Value = false;
@@ -696,6 +704,15 @@ namespace Ryujinx.Configuration
configurationFileUpdated = true;
}
+ if (configurationFileFormat.Version < 14)
+ {
+ Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 14.");
+
+ configurationFileFormat.CheckUpdatesOnStart = true;
+
+ configurationFileUpdated = true;
+ }
+
List inputConfig = new List();
inputConfig.AddRange(configurationFileFormat.ControllerConfig);
inputConfig.AddRange(configurationFileFormat.KeyboardConfig);
@@ -720,6 +737,7 @@ namespace Ryujinx.Configuration
System.SystemTimeOffset.Value = configurationFileFormat.SystemTimeOffset;
System.EnableDockedMode.Value = configurationFileFormat.DockedMode;
EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
+ CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
System.EnableMulticoreScheduling.Value = configurationFileFormat.EnableMulticoreScheduling;
System.EnablePtc.Value = configurationFileFormat.EnablePtc;
diff --git a/Ryujinx.sln b/Ryujinx.sln
index 44ab576f6c..3e557deae7 100644
--- a/Ryujinx.sln
+++ b/Ryujinx.sln
@@ -36,6 +36,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{36F870C1-3E5F-485F-B426-F0645AF78751}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
+ appveyor.yml = appveyor.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Memory", "Ryujinx.Memory\Ryujinx.Memory.csproj", "{A5E6C691-9E22-4263-8F40-42F002CE66BE}"
diff --git a/Ryujinx/Config.json b/Ryujinx/Config.json
index d0fb1fc2b0..55aaa9c2ea 100644
--- a/Ryujinx/Config.json
+++ b/Ryujinx/Config.json
@@ -1,5 +1,5 @@
{
- "version": 11,
+ "version": 14,
"res_scale": 1,
"res_scale_custom": 1,
"max_anisotropy": -1,
@@ -19,6 +19,7 @@
"system_time_offset": 0,
"docked_mode": false,
"enable_discord_integration": true,
+ "check_updates_on_start": true,
"enable_vsync": true,
"enable_multicore_scheduling": true,
"enable_ptc": false,
diff --git a/Ryujinx/Program.cs b/Ryujinx/Program.cs
index f8fb5599e9..280b5c368e 100644
--- a/Ryujinx/Program.cs
+++ b/Ryujinx/Program.cs
@@ -10,6 +10,7 @@ using Ryujinx.Ui.Diagnostic;
using System;
using System.IO;
using System.Reflection;
+using System.Threading.Tasks;
namespace Ryujinx
{
@@ -44,6 +45,9 @@ namespace Ryujinx
}
}
+ // Delete backup files after updating
+ Task.Run(Updater.CleanupUpdate);
+
Toolkit.Init(new ToolkitOptions
{
Backend = PlatformBackend.PreferNative,
@@ -122,6 +126,11 @@ namespace Ryujinx
mainWindow.LoadApplication(launchPath);
}
+ if (ConfigurationState.Instance.CheckUpdatesOnStart.Value && Updater.CanUpdate(false))
+ {
+ Updater.BeginParse(mainWindow, false);
+ }
+
Application.Run();
}
@@ -167,4 +176,4 @@ namespace Ryujinx
Logger.Shutdown();
}
}
-}
+}
\ No newline at end of file
diff --git a/Ryujinx/Ryujinx.csproj b/Ryujinx/Ryujinx.csproj
index ffb1d019a8..c4cba10867 100644
--- a/Ryujinx/Ryujinx.csproj
+++ b/Ryujinx/Ryujinx.csproj
@@ -1,4 +1,4 @@
-
+
netcoreapp3.1
@@ -42,6 +42,7 @@
+
@@ -66,6 +67,7 @@
+
@@ -75,6 +77,7 @@
+
diff --git a/Ryujinx/Ui/GLRenderer.cs b/Ryujinx/Ui/GLRenderer.cs
index 203df72ad6..637b02392e 100644
--- a/Ryujinx/Ui/GLRenderer.cs
+++ b/Ryujinx/Ui/GLRenderer.cs
@@ -135,7 +135,7 @@ namespace Ryujinx.Ui
{
if (keyboard.IsKeyDown(OpenTK.Input.Key.Escape))
{
- if (GtkDialog.CreateExitDialog())
+ if (GtkDialog.CreateChoiceDialog("Ryujinx - Exit", "Are you sure you want to stop emulation?", "All unsaved data will be lost!"))
{
Exit();
}
diff --git a/Ryujinx/Ui/GtkDialog.cs b/Ryujinx/Ui/GtkDialog.cs
index 9a14f63d3e..e72013484f 100644
--- a/Ryujinx/Ui/GtkDialog.cs
+++ b/Ryujinx/Ui/GtkDialog.cs
@@ -5,10 +5,10 @@ namespace Ryujinx.Ui
{
internal class GtkDialog : MessageDialog
{
- internal static bool _isExitDialogOpen = false;
+ private static bool _isChoiceDialogOpen;
- private GtkDialog(string title, string mainText, string secondaryText,
- MessageType messageType = MessageType.Other, ButtonsType buttonsType = ButtonsType.Ok) : base(null, DialogFlags.Modal, messageType, buttonsType, null)
+ private GtkDialog(string title, string mainText, string secondaryText, MessageType messageType = MessageType.Other, ButtonsType buttonsType = ButtonsType.Ok)
+ : base(null, DialogFlags.Modal, messageType, buttonsType, null)
{
Title = title;
Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
@@ -45,19 +45,16 @@ namespace Ryujinx.Ui
return new GtkDialog("Ryujinx - Confirmation", mainText, secondaryText, MessageType.Question, ButtonsType.YesNo);
}
- internal static bool CreateExitDialog()
+ internal static bool CreateChoiceDialog(string title, string mainText, string secondaryText)
{
- if (_isExitDialogOpen)
- {
+ if (_isChoiceDialogOpen)
return false;
- }
- _isExitDialogOpen = true;
- ResponseType res = (ResponseType)new GtkDialog("Ryujinx - Exit", "Are you sure you want to stop emulation?",
- "All unsaved data will be lost", MessageType.Question, ButtonsType.YesNo).Run();
- _isExitDialogOpen = false;
-
- return res == ResponseType.Yes;
+ _isChoiceDialogOpen = true;
+ ResponseType response = (ResponseType)new GtkDialog(title, mainText, secondaryText, MessageType.Question, ButtonsType.YesNo).Run();
+ _isChoiceDialogOpen = false;
+
+ return response == ResponseType.Yes;
}
}
}
\ No newline at end of file
diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs
index 6ce0698544..4cfcd48917 100644
--- a/Ryujinx/Ui/MainWindow.cs
+++ b/Ryujinx/Ui/MainWindow.cs
@@ -49,36 +49,38 @@ namespace Ryujinx.Ui
#pragma warning disable CS0169, CS0649, IDE0044
- [GUI] MenuBar _menuBar;
- [GUI] Box _footerBox;
- [GUI] Box _statusBar;
- [GUI] MenuItem _stopEmulation;
- [GUI] MenuItem _fullScreen;
- [GUI] CheckMenuItem _favToggle;
- [GUI] MenuItem _firmwareInstallDirectory;
- [GUI] MenuItem _firmwareInstallFile;
- [GUI] Label _hostStatus;
- [GUI] CheckMenuItem _iconToggle;
- [GUI] CheckMenuItem _developerToggle;
- [GUI] CheckMenuItem _appToggle;
- [GUI] CheckMenuItem _timePlayedToggle;
- [GUI] CheckMenuItem _versionToggle;
- [GUI] CheckMenuItem _lastPlayedToggle;
- [GUI] CheckMenuItem _fileExtToggle;
- [GUI] CheckMenuItem _pathToggle;
- [GUI] CheckMenuItem _fileSizeToggle;
- [GUI] Label _dockedMode;
- [GUI] Label _gameStatus;
- [GUI] TreeView _gameTable;
- [GUI] TreeSelection _gameTableSelection;
- [GUI] ScrolledWindow _gameTableWindow;
- [GUI] Label _gpuName;
- [GUI] Label _progressLabel;
- [GUI] Label _firmwareVersionLabel;
- [GUI] LevelBar _progressBar;
- [GUI] Box _viewBox;
- [GUI] Label _vSyncStatus;
- [GUI] Box _listStatusBox;
+ [GUI] public MenuItem ExitMenuItem;
+ [GUI] public MenuItem UpdateMenuItem;
+ [GUI] MenuBar _menuBar;
+ [GUI] Box _footerBox;
+ [GUI] Box _statusBar;
+ [GUI] MenuItem _stopEmulation;
+ [GUI] MenuItem _fullScreen;
+ [GUI] CheckMenuItem _favToggle;
+ [GUI] MenuItem _firmwareInstallDirectory;
+ [GUI] MenuItem _firmwareInstallFile;
+ [GUI] Label _hostStatus;
+ [GUI] CheckMenuItem _iconToggle;
+ [GUI] CheckMenuItem _developerToggle;
+ [GUI] CheckMenuItem _appToggle;
+ [GUI] CheckMenuItem _timePlayedToggle;
+ [GUI] CheckMenuItem _versionToggle;
+ [GUI] CheckMenuItem _lastPlayedToggle;
+ [GUI] CheckMenuItem _fileExtToggle;
+ [GUI] CheckMenuItem _pathToggle;
+ [GUI] CheckMenuItem _fileSizeToggle;
+ [GUI] Label _dockedMode;
+ [GUI] Label _gameStatus;
+ [GUI] TreeView _gameTable;
+ [GUI] TreeSelection _gameTableSelection;
+ [GUI] ScrolledWindow _gameTableWindow;
+ [GUI] Label _gpuName;
+ [GUI] Label _progressLabel;
+ [GUI] Label _firmwareVersionLabel;
+ [GUI] LevelBar _progressBar;
+ [GUI] Box _viewBox;
+ [GUI] Label _vSyncStatus;
+ [GUI] Box _listStatusBox;
#pragma warning restore CS0649, IDE0044, CS0169
@@ -1163,15 +1165,9 @@ namespace Ryujinx.Ui
private void Update_Pressed(object sender, EventArgs args)
{
- string ryuUpdater = System.IO.Path.Combine(AppDataManager.BaseDirPath, "RyuUpdater.exe");
-
- try
+ if (Updater.CanUpdate(true))
{
- Process.Start(new ProcessStartInfo(ryuUpdater, "/U") { UseShellExecute = true });
- }
- catch(System.ComponentModel.Win32Exception)
- {
- GtkDialog.CreateErrorDialog("Update canceled by user or updater was not found");
+ Updater.BeginParse(this, true);
}
}
diff --git a/Ryujinx/Ui/MainWindow.glade b/Ryujinx/Ui/MainWindow.glade
index 254d2bcd1b..26a7d75adb 100644
--- a/Ryujinx/Ui/MainWindow.glade
+++ b/Ryujinx/Ui/MainWindow.glade
@@ -81,7 +81,7 @@
-