diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index ce40e07..f5bcefb 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -1,6 +1,7 @@ using System.Reflection; using System.Security.Cryptography; using System.Windows; +using System.Windows.Shell; using System.Windows.Threading; using Microsoft.Win32; @@ -35,6 +36,8 @@ namespace Bloxstrap public static string Version = Assembly.GetExecutingAssembly().GetName().Version!.ToString()[..^2]; + public static Bootstrapper? Bootstrapper { get; set; } = null!; + public static bool IsActionBuild => !String.IsNullOrEmpty(BuildMetadata.CommitRef); public static bool IsProductionBuild => IsActionBuild && BuildMetadata.CommitRef.StartsWith("tag", StringComparison.Ordinal); @@ -104,6 +107,14 @@ namespace Bloxstrap _showingExceptionDialog = true; + if (Bootstrapper?.Dialog != null) + { + if (Bootstrapper.Dialog.TaskbarProgressValue == 0) + Bootstrapper.Dialog.TaskbarProgressValue = 1; // make sure it's visible + + Bootstrapper.Dialog.TaskbarProgressState = TaskbarItemProgressState.Error; + } + Frontend.ShowExceptionDialog(ex); Terminate(ErrorCode.ERROR_INSTALL_FAILURE); diff --git a/Bloxstrap/LaunchHandler.cs b/Bloxstrap/LaunchHandler.cs index cf7f165..35739fd 100644 --- a/Bloxstrap/LaunchHandler.cs +++ b/Bloxstrap/LaunchHandler.cs @@ -202,18 +202,18 @@ namespace Bloxstrap // start bootstrapper and show the bootstrapper modal if we're not running silently App.Logger.WriteLine(LOG_IDENT, "Initializing bootstrapper"); - var bootstrapper = new Bootstrapper(launchMode); + App.Bootstrapper = new Bootstrapper(launchMode); IBootstrapperDialog? dialog = null; if (!App.LaunchSettings.QuietFlag.Active) { App.Logger.WriteLine(LOG_IDENT, "Initializing bootstrapper dialog"); dialog = App.Settings.Prop.BootstrapperStyle.GetNew(); - bootstrapper.Dialog = dialog; - dialog.Bootstrapper = bootstrapper; + App.Bootstrapper.Dialog = dialog; + dialog.Bootstrapper = App.Bootstrapper; } - Task.Run(bootstrapper.Run).ContinueWith(t => + Task.Run(App.Bootstrapper.Run).ContinueWith(t => { App.Logger.WriteLine(LOG_IDENT, "Bootstrapper task has finished");