UI: --install-firmware startup flag.

Has the normal UI flow, this is just for systems where the file picker doesn't show up.
This commit is contained in:
Evan Husted 2025-02-19 23:07:50 -06:00
parent de16d8fa3e
commit c2ed0fd5fd
4 changed files with 32 additions and 4 deletions

View file

@ -139,8 +139,21 @@ namespace Ryujinx.Ava.UI.Windows
base.OnApplyTemplate(e);
NotificationHelper.SetNotificationManager(this);
Executor.ExecuteBackgroundAsync(ShowIntelMacWarningAsync);
Executor.ExecuteBackgroundAsync(async () =>
{
await ShowIntelMacWarningAsync();
FilePath firmwarePath = CommandLineState.FirmwareToInstallPathArg;
if (firmwarePath is not null)
{
if ((firmwarePath.ExistsAsFile && firmwarePath.Extension is "xci" or "zip") ||
firmwarePath.ExistsAsDirectory)
await Dispatcher.UIThread.InvokeAsync(() =>
ViewModel.HandleFirmwareInstallation(firmwarePath));
else
Logger.Notice.Print(LogClass.UI, "Invalid firmware type provided. Path must be a directory, or a .zip or .xci file.");
}
});
}
private void OnScalingChanged(object sender, EventArgs e)