diff --git a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs index c6fcc54d..727dc630 100644 --- a/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs +++ b/Wabbajack.App.Wpf/View Models/Installers/InstallerVM.cs @@ -164,6 +164,11 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM UIUtils.OpenFolder(_configuration.LogLocation); }); + CloseWhenCompleteCommand = ReactiveCommand.Create(() => + { + Environment.Exit(0); + }); + GoToInstallCommand = ReactiveCommand.Create(() => { UIUtils.OpenFolder(Installer.Location.TargetPath); @@ -267,16 +272,25 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM TaskBarUpdate.Send(update.StatusText, TaskbarItemProgressState.Indeterminate, update.StepsProgress.Value); }; - await installer.Begin(CancellationToken.None); - - TaskBarUpdate.Send($"Finished install of {ModList.Name}", TaskbarItemProgressState.Normal); - - InstallState = InstallState.Success; + if (!await installer.Begin(CancellationToken.None)) + { + TaskBarUpdate.Send($"Error during install of {ModList.Name}", TaskbarItemProgressState.Error); + InstallState = InstallState.Failure; + StatusText = $"Error during install of {ModList.Name}"; + StatusProgress = Percent.Zero; + } + else + { + TaskBarUpdate.Send($"Finished install of {ModList.Name}", TaskbarItemProgressState.Normal); + InstallState = InstallState.Success; + } } catch (Exception ex) { TaskBarUpdate.Send($"Error during install of {ModList.Name}", TaskbarItemProgressState.Error); InstallState = InstallState.Failure; + StatusText = $"Error during install of {ModList.Name}"; + StatusProgress = Percent.Zero; } } diff --git a/Wabbajack.App.Wpf/Views/Installers/InstallationCompleteView.xaml b/Wabbajack.App.Wpf/Views/Installers/InstallationCompleteView.xaml index 6aac0b84..74284763 100644 --- a/Wabbajack.App.Wpf/Views/Installers/InstallationCompleteView.xaml +++ b/Wabbajack.App.Wpf/Views/Installers/InstallationCompleteView.xaml @@ -24,7 +24,7 @@ - vm.InstallState) - .Select(es => es == InstallState.Success ? Visibility.Visible : Visibility.Collapsed) + .Select(es => es is InstallState.Success or InstallState.Failure ? Visibility.Visible : Visibility.Collapsed) .BindToStrict(this, view => view.InstallComplete.Visibility) .DisposeWith(disposables);