Compare commits

...

3 commits

Author SHA1 Message Date
GreemDev
c261818ef0 use a helper to get key path instead of checking mode & userpath existing every time 2025-12-08 00:26:45 -06:00
GreemDev
c149de7bfe unused property 2025-12-07 17:03:40 -06:00
GreemDev
8db5912e38 Update title with page 2025-12-07 16:57:24 -06:00
10 changed files with 37 additions and 42 deletions

View file

@ -31,6 +31,11 @@ namespace Ryujinx.Common.Configuration
public static string KeysDirPath { get; private set; }
public static string KeysDirPathUser { get; }
public static string GetKeysDir() =>
Mode is LaunchMode.UserProfile && Directory.Exists(KeysDirPathUser)
? KeysDirPathUser
: KeysDirPath;
public static string LogsDirPath { get; private set; }
public const string DefaultNandDir = "bis";

View file

@ -230,14 +230,19 @@ namespace Ryujinx.HLE.FileSystem
string consoleKeyFile = null;
string devKeyFile = null;
if (AppDataManager.Mode == AppDataManager.LaunchMode.UserProfile)
{
LoadSetAtPath(AppDataManager.KeysDirPathUser);
}
LoadSetAtPath(AppDataManager.KeysDirPath);
LoadSetAtPath(AppDataManager.GetKeysDir());
HasKeySet = (prodKeyFile != null && titleKeyFile != null) || prodKeyFile != null;
ExternalKeyReader.ReadKeyFile(
KeySet,
prodKeyFile,
devKeyFile,
titleKeyFile,
consoleKeyFile);
return;
void LoadSetAtPath(string basePath)
{
@ -266,13 +271,6 @@ namespace Ryujinx.HLE.FileSystem
devKeyFile = localDevKeyFile;
}
}
ExternalKeyReader.ReadKeyFile(
KeySet,
prodKeyFile,
devKeyFile,
titleKeyFile,
consoleKeyFile);
}
public void ImportTickets(IFileSystem fs)

View file

@ -334,7 +334,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
private static string GetKeyRetailBinPath()
{
return Path.Combine(AppDataManager.KeysDirPath, "key_retail.bin");
return Path.Combine(AppDataManager.GetKeysDir(), "key_retail.bin");
}
public static bool HasAmiiboKeyFile => File.Exists(GetKeyRetailBinPath());

View file

@ -156,12 +156,9 @@ namespace Ryujinx.Headless
option.UserProfile = profile.Name;
// Check if keys exists.
if (!File.Exists(Path.Combine(AppDataManager.KeysDirPath, "prod.keys")))
if (!File.Exists(Path.Combine(AppDataManager.GetKeysDir(), "prod.keys")))
{
if (!(AppDataManager.Mode == AppDataManager.LaunchMode.UserProfile && File.Exists(Path.Combine(AppDataManager.KeysDirPathUser, "prod.keys"))))
{
Logger.Error?.Print(LogClass.Application, "Keys not found");
}
Logger.Error?.Print(LogClass.Application, "Keys not found");
}
ReloadConfig();

View file

@ -189,12 +189,9 @@ namespace Ryujinx.Ava
DriverUtilities.InitDriverConfig(ConfigurationState.Instance.Graphics.BackendThreading == BackendThreading.Off);
// Check if keys exists.
if (!File.Exists(Path.Combine(AppDataManager.KeysDirPath, "prod.keys")))
if (!File.Exists(Path.Combine(AppDataManager.GetKeysDir(), "prod.keys")))
{
if (!(AppDataManager.Mode == AppDataManager.LaunchMode.UserProfile && File.Exists(Path.Combine(AppDataManager.KeysDirPathUser, "prod.keys"))))
{
MainWindow.ShowKeyErrorOnLoad = true;
}
MainWindow.ShowKeyErrorOnLoad = true;
}
if (CommandLineState.LaunchPathArg != null)

View file

@ -83,16 +83,9 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
try
{
string systemDirectory = AppDataManager.KeysDirPath;
if (AppDataManager.Mode == AppDataManager.LaunchMode.UserProfile &&
Directory.Exists(AppDataManager.KeysDirPathUser))
{
systemDirectory = AppDataManager.KeysDirPathUser;
}
Logger.Info?.Print(LogClass.Application, $"Installing keys from {KeysFolderPath}");
ContentManager.InstallKeys(KeysFolderPath, systemDirectory);
ContentManager.InstallKeys(KeysFolderPath, AppDataManager.GetKeysDir());
NotificationManager.Information(
title: LocaleManager.Instance[LocaleKeys.RyujinxInfo],

View file

@ -1,4 +1,5 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Notifications;
using Avalonia.Media.Imaging;
using Avalonia.Styling;
@ -22,6 +23,12 @@ namespace Ryujinx.Ava.UI.SetupWizard
private readonly RyujinxSetupWizardWindow _window;
private readonly bool _overwrite;
public void SetWindowTitle(string titleText)
{
_window.Title = titleText;
ToolTip.SetTip(_window.RyuLogo, titleText);
}
public RyujinxSetupWizard(RyujinxSetupWizardWindow wizardWindow, bool overwriteMode)
{
_window = wizardWindow;
@ -32,6 +39,10 @@ namespace Ryujinx.Ava.UI.SetupWizard
UpdateLogoTheme(ConfigurationState.Instance.UI.BaseStyle);
RyujinxApp.ThemeChanged += Ryujinx_ThemeChanged;
}
else
{
UpdateLogoTheme("Dark");
}
}
private SetupWizardPage FirstPage() => new(_window.WizardPresenter, this, isFirstPage: true);

View file

@ -2,18 +2,16 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:windows="clr-namespace:Ryujinx.Ava.UI.Windows"
xmlns:setupWizard="clr-namespace:Ryujinx.Ava.UI.SetupWizard"
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
CanResize="False"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Ryujinx.Ava.UI.SetupWizard.RyujinxSetupWizardWindow"
x:DataType="setupWizard:RyujinxSetupWizard"
Title="{ext:Locale SetupWizardFirstPageTitle}">
x:DataType="setupWizard:RyujinxSetupWizard">
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" RowDefinitions="Auto,*">
<Grid Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Name="FlushControls">
<controls:RyujinxLogo ToolTip.Tip="{ext:Locale SetupWizardFirstPageTitle}"/>
<controls:RyujinxLogo Name="RyuLogo"/>
</Grid>
<ContentPresenter Grid.Row="1" Name="WizardPresenter"/>
</Grid>

View file

@ -50,6 +50,7 @@ namespace Ryujinx.Ava.UI.SetupWizard
public async ValueTask<bool> Show()
{
contentPresenter.Content = new SetupWizardPageView { ViewModel = this };
ownerWizard.SetWindowTitle(Title);
try
{

View file

@ -1018,12 +1018,7 @@ namespace Ryujinx.Ava.UI.ViewModels
{
try
{
string systemDirectory = AppDataManager.KeysDirPath;
if (AppDataManager.Mode == AppDataManager.LaunchMode.UserProfile &&
Directory.Exists(AppDataManager.KeysDirPathUser))
{
systemDirectory = AppDataManager.KeysDirPathUser;
}
string systemDirectory = AppDataManager.GetKeysDir();
string dialogTitle =
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogKeysInstallerKeysInstallTitle);