diff --git a/Assets/LogoWithClosedPackage.ico b/Assets/LogoWithClosedPackage.ico new file mode 100644 index 0000000..6154297 Binary files /dev/null and b/Assets/LogoWithClosedPackage.ico differ diff --git a/Assets/LogoWithClosedPackage.svg b/Assets/LogoWithClosedPackage.svg new file mode 100644 index 0000000..a0a1e6f --- /dev/null +++ b/Assets/LogoWithClosedPackage.svg @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PackageInstaller.Core/ModelViews/GettingStartedModelView.cs b/PackageInstaller.Core/ModelViews/GettingStartedModelView.cs index 9b659c8..eac8e5d 100644 --- a/PackageInstaller.Core/ModelViews/GettingStartedModelView.cs +++ b/PackageInstaller.Core/ModelViews/GettingStartedModelView.cs @@ -1,5 +1,6 @@ using System.Reactive; using System.Reactive.Linq; +using System.Reactive.Threading.Tasks; using ReactiveUI; using Sextant; using Shared.Misc; @@ -32,6 +33,11 @@ IApplicationLifeCycle lifeCycle LaunchExplorerCommand = ReactiveCommand.CreateFromTask(LaunchExplorerAsync); LaunchWithFileCommand = ReactiveCommand.CreateFromTask(LaunchWithFileAsync); ExitCommand = ReactiveCommand.Create(() => _lifeCycle.Exit(0)); + OpenDefaultAppsSettingsPageCommand = ReactiveCommand.CreateFromTask( + _launcher.LaunchDefaultAppsSettingsPageAsync + ); + + _userShouldCheckFileHandlerRegistrations = false; } private async Task LaunchWithFileAsync(string? filePath) @@ -75,6 +81,17 @@ private async Task PickFilesAsync() public ReactiveCommand LaunchExplorerCommand { get; } public ReactiveCommand LaunchWithFileCommand { get; } public ReactiveCommand ExitCommand { get; } + public ReactiveCommand OpenDefaultAppsSettingsPageCommand { get; } + + bool _userShouldCheckFileHandlerRegistrations; + public bool UserShouldCheckFileHandlerRegistrations + { + get { return _userShouldCheckFileHandlerRegistrations; } + private set + { + this.RaiseAndSetIfChanged(ref _userShouldCheckFileHandlerRegistrations, value); + } + } public string Id { get; } = nameof(GettingStartedModelView); @@ -92,6 +109,15 @@ public IObservable WhenNavigatedFrom(INavigationParameter parameter) public IObservable WhenNavigatingTo(INavigationParameter parameter) { - return Observable.Return(Unit.Default); + return ProcessAsync().ToObservable(RxApp.MainThreadScheduler); + } + + public async Task ProcessAsync() + { + await Task.Delay(10).ConfigureAwait(true); + + UserShouldCheckFileHandlerRegistrations = !await _launcher + .VerifyThatAllFileTypeAssociationsAreRegisteredAsync() + .ConfigureAwait(true); } } diff --git a/PackageInstaller.Core/ModelViews/PreparationViewModel.cs b/PackageInstaller.Core/ModelViews/PreparationViewModel.cs index 9e48137..f59d3da 100644 --- a/PackageInstaller.Core/ModelViews/PreparationViewModel.cs +++ b/PackageInstaller.Core/ModelViews/PreparationViewModel.cs @@ -106,7 +106,9 @@ public async Task ProcessAsync(string[] arguments) private void NavigateToGettingStarted() { - _viewStackService.PushPage().Subscribe(); + _viewStackService + .PushPage(new Sextant.NavigationParameter()) + .Subscribe(); } private FileSystemPath ParseArguments(string[] arguments) diff --git a/PackageInstaller/MainWindow.xaml.cs b/PackageInstaller/MainWindow.xaml.cs index 7ca54fe..52219f7 100644 --- a/PackageInstaller/MainWindow.xaml.cs +++ b/PackageInstaller/MainWindow.xaml.cs @@ -1,8 +1,11 @@ using Microsoft.UI.Xaml; using System; +using System.IO; using System.Linq; using System.Reactive; using System.Threading; +using Windows.ApplicationModel; +using Windows.Storage; using Community.Sextant.WinUI; using Community.Sextant.WinUI.Adapters; using NativeInterop.Win32.Xaml; @@ -23,24 +26,33 @@ public sealed partial class MainWindow : DesktopWindow private readonly ThemeManager _themeManager; private string args = string.Empty; private readonly IApplicationLifeCycle _lifeCycle; + private IPath _path; public MainWindow( IParameterViewStackService viewStackService, INavigationService navigationService, ThemeManager themeManager, - IApplicationLifeCycle lifeCycle + IApplicationLifeCycle lifeCycle, + IPath path ) { _viewStackService = viewStackService; _navigationService = navigationService; _themeManager = themeManager; _lifeCycle = lifeCycle; + _path = path; this.InitializeComponent(); Title = "Winstrumenta PackageManager"; ExtendsContentIntoTitleBar = true; SetTitleBar(DummyTitleBar); // do not set the title bar to use a 100% custom one. + + var iconPath = Path.Combine(Package.Current.InstalledPath, "PackageInstaller.ico"); + if (File.Exists(iconPath)) + { + _nativeWindow.LoadIcon(iconPath); + } } public void SetLaunchArgs(string arguments) diff --git a/PackageInstaller/PackageInstaller.csproj b/PackageInstaller/PackageInstaller.csproj index a99fdf9..7db1a9e 100644 --- a/PackageInstaller/PackageInstaller.csproj +++ b/PackageInstaller/PackageInstaller.csproj @@ -85,6 +85,7 @@ + @@ -145,6 +146,7 @@ + diff --git a/PackageInstaller/PackageInstaller.ico b/PackageInstaller/PackageInstaller.ico new file mode 100644 index 0000000..6154297 Binary files /dev/null and b/PackageInstaller/PackageInstaller.ico differ diff --git a/PackageInstaller/Pages/GettingStarted.xaml b/PackageInstaller/Pages/GettingStarted.xaml index 03950fa..079abe8 100644 --- a/PackageInstaller/Pages/GettingStarted.xaml +++ b/PackageInstaller/Pages/GettingStarted.xaml @@ -25,6 +25,7 @@ + - Double click in Windows Explorer to install + Double click package files in Windows Explorer to install - + + Remember to change the default file type associations. + +