Warn if launching multiple instances (#606)

This commit is contained in:
pizzaboxer 2024-06-07 12:34:58 +01:00
parent f662d0d8c3
commit 243ebbef5a
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
2 changed files with 16 additions and 1 deletions

View File

@ -210,6 +210,21 @@ namespace Bloxstrap
if (!IsFirstRun)
ShouldSaveConfigs = true;
if (Mutex.TryOpenExisting("ROBLOX_singletonMutex", out var _))
{
var result = Frontend.ShowMessageBox(
"Roblox is currently running, and launching another instance will close it. Are you sure you want to continue launching?",
MessageBoxImage.Warning,
MessageBoxButton.YesNo
);
if (result != MessageBoxResult.Yes)
{
StartupFinished();
return;
}
}
// start bootstrapper and show the bootstrapper modal if we're not running silently
Logger.WriteLine(LOG_IDENT, "Initializing bootstrapper");
Bootstrapper bootstrapper = new(LaunchSettings.RobloxLaunchArgs, LaunchSettings.RobloxLaunchMode);

View File

@ -112,7 +112,7 @@ namespace Bloxstrap.UI.Elements.ContextMenu
private void LogTracerMenuItem_Click(object sender, RoutedEventArgs e)
{
Utilities.ShellExecute(_activityWatcher?.LogLocation);
Utilities.ShellExecute(_activityWatcher?.LogLocation!);
}
private void CloseRobloxMenuItem_Click(object sender, RoutedEventArgs e)