From 404354797a66ea078c5736ca59c961644435b57e Mon Sep 17 00:00:00 2001 From: patel-nikhil Date: Mon, 6 Dec 2021 19:54:11 -0500 Subject: [PATCH] Re-enable GUI after error message on install --- UnofficialCrusaderPatchGUI/MainWindow.xaml.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/UnofficialCrusaderPatchGUI/MainWindow.xaml.cs b/UnofficialCrusaderPatchGUI/MainWindow.xaml.cs index a4db87c3..2413feb9 100644 --- a/UnofficialCrusaderPatchGUI/MainWindow.xaml.cs +++ b/UnofficialCrusaderPatchGUI/MainWindow.xaml.cs @@ -252,8 +252,25 @@ void DoSetup(object arg) } catch (Exception e) { - if (!(e is TaskCanceledException || e is ThreadAbortException)) // in case of exit + // in case of exit + if (!(e is TaskCanceledException || e is ThreadAbortException)) + { MessageBox.Show(e.ToString(), Localization.Get("ui_error")); + } + else + { + MessageBox.Show(e.ToString(), e.Message); + } + + Dispatcher.Invoke(DispatcherPriority.Render, new Action(() => + { + iButtonInstall.IsEnabled = true; + pButtonSearch.IsEnabled = true; + pTextBoxPath.IsReadOnly = false; + Version.Changes.ForEach(c => c.SetUIEnabled(true)); + pbSetup.Value = 0; + pbLabel.Content = Localization.Get("ui_finished"); + })); } }