From f0955a7572d4fddc4a1fc5e69c30e6b3c30e30da Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Sun, 29 Aug 2021 22:32:39 -0500 Subject: [PATCH] Moved OutputBox "write line" code --- Installer/Steps/S04_Installing.xaml.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Installer/Steps/S04_Installing.xaml.cs b/Installer/Steps/S04_Installing.xaml.cs index 36ec2b77..56113198 100644 --- a/Installer/Steps/S04_Installing.xaml.cs +++ b/Installer/Steps/S04_Installing.xaml.cs @@ -36,7 +36,7 @@ private async void Step_Loaded(object sender, RoutedEventArgs e) App.InstallerWindow.SetCancelButtonEnabled(); // Extract ZIP to temp folder - OutputBox.Text += "Extracting installer...\r\n"; + OutputBoxWriteLine("Extracting installer..."); TempFolder = Directory.CreateDirectory(Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "FluentStoreInstaller")); ZipFile = new(Path.Combine(TempFolder.FullName, "FluentStore_Beta.zip")); @@ -82,7 +82,7 @@ private async void Step_Loaded(object sender, RoutedEventArgs e) App.InstallerWindow.ShowErrorMessage("Failed to start install script."); return; } - OutputBox.Text += "Beginning install...\r\n"; + OutputBoxWriteLine("Beginning install..."); psProc.BeginErrorReadLine(); await psProc.StandardOutput.ReadLineAsync(); await Task.Delay(100); @@ -122,7 +122,7 @@ private async void Step_Loaded(object sender, RoutedEventArgs e) continue; Debug.WriteLine("\tOut> " + line); - OutputBox.Text += line.Replace(App.InstallerDir.FullName, "$(InstallerPath)") + "\r\n"; + OutputBoxWriteLine(line.Replace(App.InstallerDir.FullName, "$(InstallerPath)")); if (line.Contains("HRESULT")) { // Error occurred @@ -173,6 +173,11 @@ private async void Step_Loaded(object sender, RoutedEventArgs e) } } + private void OutputBoxWriteLine(string line) + { + OutputBox.Text += line + "\r\n"; + } + public void Cancel() { try