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" =>