Skip to content

Commit

Permalink
Moved OutputBox "write line" code
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshiask committed Aug 30, 2021
1 parent 0e62ade commit f0955a7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Installer/Steps/S04_Installing.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f0955a7

Please sign in to comment.