fix: require valid key installations before moving onto firmware setup step

This commit is contained in:
GreemDev 2025-11-22 17:44:16 -06:00
parent 94cb992083
commit fa3a0c11ce
4 changed files with 31 additions and 30 deletions

View file

@ -2,7 +2,7 @@ using System;
namespace Ryujinx.HLE.Exceptions namespace Ryujinx.HLE.Exceptions
{ {
class InvalidFirmwarePackageException : Exception public class InvalidFirmwarePackageException : Exception
{ {
public InvalidFirmwarePackageException(string message) : base(message) { } public InvalidFirmwarePackageException(string message) : base(message) { }
} }

View file

@ -4,10 +4,10 @@ using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.Exceptions;
using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.FileSystem;
using System; using System;
using System.IO; using System.IO;
using System.Threading;
namespace Ryujinx.Ava.UI.SetupWizard namespace Ryujinx.Ava.UI.SetupWizard
{ {
@ -26,16 +26,22 @@ namespace Ryujinx.Ava.UI.SetupWizard
Logger.Info?.Print(LogClass.Application, $"Installing keys from {directory}"); Logger.Info?.Print(LogClass.Application, $"Installing keys from {directory}");
Thread thread = new(() =>
{
try
{
ContentManager.InstallKeys(directory, systemDirectory); ContentManager.InstallKeys(directory, systemDirectory);
NotificationHelper.ShowInformation( NotificationHelper.ShowInformation(
title: LocaleManager.Instance[LocaleKeys.RyujinxInfo], title: LocaleManager.Instance[LocaleKeys.RyujinxInfo],
text: LocaleManager.Instance[LocaleKeys.DialogKeysInstallerKeysInstallSuccessMessage]); 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) catch (Exception ex)
{ {
string message = ex.Message; string message = ex.Message;
@ -46,24 +52,13 @@ namespace Ryujinx.Ava.UI.SetupWizard
} }
NotificationHelper.ShowError(message, waitingExit: true); NotificationHelper.ShowError(message, waitingExit: true);
return Result.Failure(new MessageError(ex.Message));
} }
finally finally
{ {
mwvm.VirtualFileSystem.ReloadKeySet(); 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; return Result.Success;
} }

View file

@ -75,6 +75,12 @@ namespace Ryujinx.Ava.UI.SetupWizard
{ {
if (!HasFirmware) 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: Retry:
SetupFirmwarePageViewModel fwvm = new(); SetupFirmwarePageViewModel fwvm = new();
bool result = await NextPage() bool result = await NextPage()