feat(launcher): add verified first-run installer

This commit is contained in:
Erik 2026-08-14 20:06:37 +02:00
parent 60f627998c
commit ff6ebb6a6a
28 changed files with 3259 additions and 125 deletions

View file

@ -2,7 +2,9 @@ using System.ComponentModel;
using AcDream.Launcher.ViewModels;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.Platform.Storage;
using Avalonia.Threading;
namespace AcDream.Launcher;
@ -116,7 +118,7 @@ public sealed partial class MainWindow : Window
}
else if (viewModel.FirstRunWizardShell.IsOpen)
{
FirstRunCloseButton.Focus();
FirstRunDatDirectoryTextBox.Focus();
}
else if (viewModel.UpdatePromptShell.IsOpen)
{
@ -134,4 +136,33 @@ public sealed partial class MainWindow : Window
viewModel.CloseActiveModal();
e.Handled = true;
}
private async void OnBrowseDatDirectory(object? sender, RoutedEventArgs e)
{
if (DataContext is not LauncherWindowViewModel viewModel)
{
return;
}
try
{
IReadOnlyList<IStorageFolder> folders = await StorageProvider
.OpenFolderPickerAsync(new FolderPickerOpenOptions
{
Title = "Choose the retail Asheron's Call DAT directory",
AllowMultiple = false,
});
if (folders.Count > 0)
{
viewModel.FirstRunWizardShell.SelectDatDirectory(
folders[0].Path.LocalPath);
}
}
catch (Exception ex)
{
viewModel.FirstRunWizardShell.ReportPickerError(ex.Message);
}
e.Handled = true;
}
}