Every time the launcher starts it must locate theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/retired64/sm64coopdx_launcher/llms.txt
Use this file to discover all available pages before exploring further.
sm64coopdx binary before it can launch the game. Rather than requiring explicit configuration, it works through a five-tier priority chain — from the most specific override (a CLI flag you pass directly) down to a broad automatic search of your home directory. The chain is sequential and fault-tolerant: if a configured path points to a file that does not exist, the launcher logs a warning and tries the next tier instead of failing immediately.
Priority chain overview
| Priority | Source | Example |
|---|---|---|
| 1 (highest) | --game-path CLI flag | ./sm64coopdx-launcher --game-path /opt/sm64/sm64coopdx |
| 2 | SM64COOPDX_PATH environment variable | export SM64COOPDX_PATH=/opt/sm64/sm64coopdx |
| 3 | Per-profile game_path in profile.json | ~/.local/share/sm64coopdx/profiles/MyProfile/profile.json |
| 4 | launcher.toml → [game].path | ~/.config/sm64coopdx/launcher.toml |
| 5 (lowest) | Auto-detection (four search paths) | Scans ../games/mario64/, ./, ../, and ~/sm64coopdx_Linux-*/ |
current_dir logic could produce an incorrect double-prefix when spawning the game process.
Tier 1 — CLI flag --game-path
Passing --game-path <PATH> on the command line is the highest-priority override. Use it for one-off launches or scripting without touching any stored configuration.
Tier 2 — Environment variable SM64COOPDX_PATH
Set the SM64COOPDX_PATH variable in your shell environment. This is a good choice when you want a persistent override that applies every session without editing any config file.
Tier 3 — Per-profile game_path
Each player profile can embed its own binary path in profile.json, located at:
game_path field alongside the other profile options:
launcher.toml, so it overrides the global config file while still losing to the environment.
Tier 4 — launcher.toml
The [game].path field in ~/.config/sm64coopdx/launcher.toml is the standard persistent configuration method when you do not need per-profile differences. See Configure the launcher with launcher.toml for full details.
Tier 5 — Auto-detection
When no explicit path is found in tiers 1–4, the launcher searches four candidate locations in order. The first path that resolves to an existing file is used.games/mario64/ subdirectory
games/ directory one level up.Same directory as the launcher
sm64coopdx-launcher.Parent directory
<launcher_dir> refers to the directory containing the sm64coopdx-launcher executable, determined at runtime via std::env::current_exe(). It is not the working directory from which you run the launcher.Fall-through behavior
Every tier follows the same validation rule: if the path string is present but does not point to an existing file on disk, it is skipped with aWARN-level log message and the next tier is tried. A non-existent path never causes an immediate error — the error only surfaces if all five tiers are exhausted without finding a valid file.
Choosing the right tier
One-off override
Use the
--game-path CLI flag. No files are changed; the override only applies for that single launch.Session-wide default
Export
SM64COOPDX_PATH in your shell profile. Takes effect in every new terminal session without editing config files.Per-profile binary
Add
game_path to the profile’s profile.json. Best when you run multiple game versions under separate profiles.Permanent global config
Set
[game].path in ~/.config/sm64coopdx/launcher.toml. The simplest persistent option for single-installation setups.