mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-12 07:36:59 +00:00
fix: require valid key installations before moving onto firmware setup step
This commit is contained in:
parent
94cb992083
commit
fa3a0c11ce
4 changed files with 31 additions and 30 deletions
|
|
@ -2,7 +2,7 @@ using System;
|
|||
|
||||
namespace Ryujinx.HLE.Exceptions
|
||||
{
|
||||
class InvalidFirmwarePackageException : Exception
|
||||
public class InvalidFirmwarePackageException : Exception
|
||||
{
|
||||
public InvalidFirmwarePackageException(string message) : base(message) { }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ using Ryujinx.Ava.Common.Locale;
|
|||
using Ryujinx.Ava.UI.Helpers;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.Exceptions;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace Ryujinx.Ava.UI.SetupWizard
|
||||
{
|
||||
|
|
@ -26,16 +26,22 @@ namespace Ryujinx.Ava.UI.SetupWizard
|
|||
|
||||
Logger.Info?.Print(LogClass.Application, $"Installing keys from {directory}");
|
||||
|
||||
Thread thread = new(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
ContentManager.InstallKeys(directory, systemDirectory);
|
||||
|
||||
NotificationHelper.ShowInformation(
|
||||
title: LocaleManager.Instance[LocaleKeys.RyujinxInfo],
|
||||
text: LocaleManager.Instance[LocaleKeys.DialogKeysInstallerKeysInstallSuccessMessage]);
|
||||
}
|
||||
catch (InvalidFirmwarePackageException ifwpe)
|
||||
{
|
||||
NotificationHelper.ShowError(ifwpe.Message, waitingExit: true);
|
||||
return Result.Failure(NoKeysFoundInFolder.Shared);
|
||||
}
|
||||
catch (MissingKeyException ex)
|
||||
{
|
||||
NotificationHelper.ShowError(ex.ToString(), waitingExit: true);
|
||||
return Result.Failure(NoKeysFoundInFolder.Shared);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string message = ex.Message;
|
||||
|
|
@ -46,24 +52,13 @@ namespace Ryujinx.Ava.UI.SetupWizard
|
|||
}
|
||||
|
||||
NotificationHelper.ShowError(message, waitingExit: true);
|
||||
|
||||
return Result.Failure(new MessageError(ex.Message));
|
||||
}
|
||||
finally
|
||||
{
|
||||
mwvm.VirtualFileSystem.ReloadKeySet();
|
||||
}
|
||||
}) { Name = "GUI.KeysInstallerThread" };
|
||||
|
||||
thread.Start();
|
||||
}
|
||||
catch (MissingKeyException ex)
|
||||
{
|
||||
NotificationHelper.ShowError(ex.ToString(), waitingExit: true);
|
||||
return Result.Failure(NoKeysFoundInFolder.Shared);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Result.Failure(new MessageError(ex.Message));
|
||||
}
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,12 @@ namespace Ryujinx.Ava.UI.SetupWizard
|
|||
{
|
||||
if (!HasFirmware)
|
||||
{
|
||||
if (!mwvm.VirtualFileSystem.HasKeySet)
|
||||
{
|
||||
NotificationHelper.ShowError("Keys still seem to not be installed. Are you sure they're in that folder?");
|
||||
return false;
|
||||
}
|
||||
|
||||
Retry:
|
||||
SetupFirmwarePageViewModel fwvm = new();
|
||||
bool result = await NextPage()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue