From 8447581fe65bbf5ae8915a199c97cd4269a6d2ed Mon Sep 17 00:00:00 2001 From: funman300 Date: Sun, 19 Apr 2026 10:56:42 -0700 Subject: [PATCH] detect: fix SKIP_DIRS blocking game discovery for Epic, Ubisoft, Rockstar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SKIP_DIRS contained parent directories that also contain game installs, which prevented those games from ever being scanned: - "epic games" → all Epic games live inside this dir - "ubisoft" → Ubisoft games at Ubisoft/Ubisoft Game Launcher/games/ - "rockstar games" → Rockstar games live directly inside this dir - "electronic arts" → some EA games live here SKIP_EXES already filters the individual launcher executables, so the directory-level blocks are redundant and harmful. Trim SKIP_DIRS to only directories that genuinely contain no game executables (battle.net, ea desktop, gog galaxy, Wine infrastructure). Add missing launcher path patterns to name_from_launcher_path: - "ea games" → EA Games// - "ubisoft game launcher" → Ubisoft Game Launcher/games// Co-Authored-By: Claude Sonnet 4.6 --- src/detect.rs | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/detect.rs b/src/detect.rs index 448d469..0f58953 100644 --- a/src/detect.rs +++ b/src/detect.rs @@ -52,15 +52,13 @@ const SYSTEM_DIRS: &[&str] = &[ "windowsapps", ]; -/// Directory names that contain launcher infrastructure, not games. +/// Directory names that are pure launcher infrastructure — no game executables +/// are ever installed here. Do NOT add parent dirs like "Epic Games" or +/// "Ubisoft" that also contain game subdirectories; use SKIP_EXES instead. const SKIP_DIRS: &[&str] = &[ - "battle.net", - "electronic arts", - "ea desktop", - "epic games", - "gog galaxy", - "ubisoft", - "rockstar games", + "battle.net", // Battle.net launcher dir; its games live elsewhere + "ea desktop", // EA Desktop launcher subfolder only + "gog galaxy", // GOG Galaxy launcher; games are normally in GOG Games/ "wine", "mono", "gecko", @@ -402,19 +400,25 @@ fn read_epic_manifest(dir: &Path) -> Option { /// /// Launchers install each game into a named subdirectory of their own folder. /// That subdirectory name *is* the display name: -/// - Epic: `…/Epic Games//…` -/// - GOG: `…/GOG Games//…` -/// - Steam: `…/steamapps/common//…` +/// - Epic: `…/Epic Games//…` +/// - GOG: `…/GOG Games//…` +/// - Steam: `…/steamapps/common//…` /// - Rockstar:`…/Rockstar Games//…` +/// - EA: `…/EA Games//…` +/// - Ubisoft: `…/Ubisoft Game Launcher/games//…` fn name_from_launcher_path(exe_path: &Path) -> Option { let comps: Vec<&std::ffi::OsStr> = exe_path.components().map(|c| c.as_os_str()).collect(); for (i, comp) in comps.iter().enumerate() { let lower = comp.to_str().unwrap_or("").to_lowercase(); match lower.as_str() { - "epic games" | "gog games" | "rockstar games" => { + "epic games" | "gog games" | "rockstar games" | "ea games" => { return comps.get(i + 1).and_then(|c| c.to_str()).map(str::to_string); } + // Ubisoft: …/Ubisoft Game Launcher/games//… + "ubisoft game launcher" => { + return comps.get(i + 2).and_then(|c| c.to_str()).map(str::to_string); + } "common" if i > 0 && comps[i - 1].to_str().unwrap_or("").to_lowercase() == "steamapps" =>