mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 23:03:51 +02:00
Change --config behavior to allow for multi instance
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Pipes;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
@@ -31,14 +32,22 @@ namespace VRCX
|
||||
LaunchCommand = arg.Substring(12);
|
||||
|
||||
if (arg.Length > 8 && arg.Substring(0, 8) == "--config")
|
||||
Program.ConfigLocation = arg.Substring(9);
|
||||
{
|
||||
var filePath = arg.Substring(9);
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
MessageBox.Show("Move your \"VRCX.sqlite3\" into a folder then specify the folder in the launch parameter e.g.\n--config=\"C:\\VRCX\\\"", "--config is now a directory", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Environment.Exit(0);
|
||||
}
|
||||
Program.AppDataDirectory = filePath;
|
||||
}
|
||||
|
||||
if ((arg.Length >= 7 && arg.Substring(0, 7) == "--debug") || isDebug)
|
||||
Program.LaunchDebug = true;
|
||||
}
|
||||
|
||||
if (processList.Length > 1 && !string.IsNullOrEmpty(LaunchCommand))
|
||||
return; // if we're launching with a parameter, allow it
|
||||
if (!string.IsNullOrEmpty(Program.AppDataDirectory))
|
||||
return; // we're launching with a custom config path, allow it
|
||||
|
||||
// if we're launching a second instance, focus the first instance then exit
|
||||
if (processList.Length > 1)
|
||||
|
||||
Reference in New Issue
Block a user