diff --git a/Program.cs b/Program.cs index 59fcaa31..4bfeb346 100644 --- a/Program.cs +++ b/Program.cs @@ -13,11 +13,13 @@ namespace VRCX { public static string BaseDirectory { get; private set; } public static string AppDataDirectory { get; private set; } + public static string ConfigLocation; static Program() { BaseDirectory = AppDomain.CurrentDomain.BaseDirectory; AppDataDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "VRCX"); + ConfigLocation = Path.Combine(Program.AppDataDirectory, "VRCX.sqlite3"); if (!Directory.Exists(AppDataDirectory)) { @@ -46,7 +48,7 @@ namespace VRCX } catch (Exception e) { - MessageBox.Show(e.ToString(), "PLEASE REPORT TO PYPY", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(e.ToString(), "PLEASE REPORT IN https://vrcx.pypy.moe/discord", MessageBoxButtons.OK, MessageBoxIcon.Error); Environment.Exit(0); } } diff --git a/SQLite.cs b/SQLite.cs index 98b2c6d5..5bd26aa8 100644 --- a/SQLite.cs +++ b/SQLite.cs @@ -22,7 +22,7 @@ namespace VRCX { m_ConnectionLock = new ReaderWriterLockSlim(); - var dataSource = Path.Combine(Program.AppDataDirectory, "VRCX.sqlite3"); + var dataSource = Program.ConfigLocation; m_Connection = new SQLiteConnection($"Data Source=\"{dataSource}\";Version=3;PRAGMA locking_mode=NORMAL;PRAGMA busy_timeout=5000", true); } diff --git a/StartupArgs.cs b/StartupArgs.cs index a849cf06..5c7dca8a 100644 --- a/StartupArgs.cs +++ b/StartupArgs.cs @@ -25,6 +25,9 @@ namespace VRCX { if (arg.Length > 12 && arg.Substring(0, 12) == "/uri=vrcx://") LaunchCommand = arg.Substring(12); + + if (arg.Length > 12 && arg.Substring(0, 8) == "--config") + Program.ConfigLocation = arg.Substring(9); } if (processList.Length > 1 && String.IsNullOrEmpty(LaunchCommand))