From 19d3deecf477ad72e6cc11a4ed94263a25b337b1 Mon Sep 17 00:00:00 2001 From: pizzaboxer <41478239+pizzaboxer@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:14:03 +0000 Subject: [PATCH] Fix bug with app still runnning in background --- Bloxstrap/App.xaml.cs | 14 ++++++-------- Bloxstrap/Properties/launchSettings.json | 4 ++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 6e6eb7b..2a50550 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -107,7 +107,7 @@ namespace Bloxstrap // preferences dialog was closed, and so base directory was never set // (this doesnt account for the registry value not existing but thats basically never gonna happen) if (String.IsNullOrEmpty(BaseDirectory)) - return; + Environment.Exit(Bootstrapper.ERROR_INSTALL_USEREXIT); Directories.Initialize(BaseDirectory); @@ -128,18 +128,17 @@ namespace Bloxstrap string commandLine = ""; -#if DEBUG - new Preferences().ShowDialog(); -#else if (LaunchArgs.Length > 0) { if (LaunchArgs[0] == "-preferences") { +#if !DEBUG if (Process.GetProcessesByName(ProjectName).Length > 1) { - ShowMessageBox($"{ProjectName} is already running. Please close any currently open Bloxstrap or Roblox window before opening the configuration menu.", MessageBoxImage.Error); - return; + ShowMessageBox($"{ProjectName} is currently running. Please close any currently open Bloxstrap or Roblox window before opening the menu.", MessageBoxImage.Error); + Environment.Exit(0); } +#endif new Preferences().ShowDialog(); } @@ -160,7 +159,6 @@ namespace Bloxstrap { commandLine = "--app"; } -#endif if (!String.IsNullOrEmpty(commandLine)) { @@ -168,7 +166,7 @@ namespace Bloxstrap Settings.BootstrapperStyle.Show(new Bootstrapper(commandLine)); } - SettingsManager.Save(); + Terminate(); } } } diff --git a/Bloxstrap/Properties/launchSettings.json b/Bloxstrap/Properties/launchSettings.json index 4ac77ad..baeb018 100644 --- a/Bloxstrap/Properties/launchSettings.json +++ b/Bloxstrap/Properties/launchSettings.json @@ -2,6 +2,10 @@ "profiles": { "Bloxstrap": { "commandName": "Project" + }, + "Bloxstrap (Menu)": { + "commandName": "Project", + "commandLineArgs": "-preferences" } } } \ No newline at end of file