diff --git a/Dotnet/AutoAppLaunchManager.cs b/Dotnet/AutoAppLaunchManager.cs index cf5054e1..35fa9354 100644 --- a/Dotnet/AutoAppLaunchManager.cs +++ b/Dotnet/AutoAppLaunchManager.cs @@ -23,6 +23,8 @@ namespace VRCX public bool KillChildrenOnExit = true; public bool RunProcessOnce = true; public readonly string AppShortcutDirectory; + public readonly string AppShortcutDesktop; + public readonly string AppShortcutVR; private DateTime startTime = DateTime.Now; private Dictionary> startedProcesses = new Dictionary>(); @@ -66,11 +68,12 @@ namespace VRCX public AutoAppLaunchManager() { AppShortcutDirectory = Path.Join(Program.AppDataDirectory, "startup"); + AppShortcutDesktop = Path.Join(AppShortcutDirectory, "desktop"); + AppShortcutVR = Path.Join(AppShortcutDirectory, "vr"); - if (!Directory.Exists(AppShortcutDirectory)) - { - Directory.CreateDirectory(AppShortcutDirectory); - } + Directory.CreateDirectory(AppShortcutDirectory); + Directory.CreateDirectory(AppShortcutDesktop); + Directory.CreateDirectory(AppShortcutVR); ProcessMonitor.Instance.ProcessStarted += OnProcessStarted; ProcessMonitor.Instance.ProcessExited += OnProcessExited; @@ -111,6 +114,7 @@ namespace VRCX UpdateChildProcesses(); var shortcutFiles = FindShortcutFiles(AppShortcutDirectory); + shortcutFiles.AddRange(FindShortcutFiles(Program.AppApiInstance.IsSteamVRRunning() ? AppShortcutVR : AppShortcutDesktop)); foreach (var file in shortcutFiles) { if (RunProcessOnce && IsProcessRunning(file)) @@ -122,7 +126,7 @@ namespace VRCX StartChildProcess(file); } - if (shortcutFiles.Length == 0) + if (shortcutFiles.Count == 0) return; timerTicks = 0; @@ -328,7 +332,7 @@ namespace VRCX /// /// The folder path. /// An array of shortcut paths. If none, then empty. - private static string[] FindShortcutFiles(string folderPath) + private static List FindShortcutFiles(string folderPath) { DirectoryInfo directoryInfo = new DirectoryInfo(folderPath); FileInfo[] files = directoryInfo.GetFiles(); @@ -342,7 +346,7 @@ namespace VRCX } } - return ret.ToArray(); + return ret; } /// diff --git a/src/localization/en/en.json b/src/localization/en/en.json index c86710b8..063bf3bd 100644 --- a/src/localization/en/en.json +++ b/src/localization/en/en.json @@ -664,7 +664,7 @@ "app_launcher": { "header": "App Launcher", "folder": "Auto-Launch Folder", - "folder_tooltip": "To auto-launch apps with VRChat, place shortcuts in this folder.", + "folder_tooltip": "To auto-launch apps with VRChat, place shortcuts inside this folder, alteratively use the platform-specific subfolders", "enable": "Enable", "auto_close": "Auto close apps", "run_process_once": "Open single instance of app"