Skip to main content

Module launch

Module launch 

Source
Expand description

Compute a launch invocation and stage loader files. Compute how to launch a game with a target directory’s mods applied.

The engine produces a LaunchPlan — the program to start, its argv, its environment, and a working directory — and the caller spawns it. The engine never discovers a game directory, never reads the host platform, and never starts a process; platform facts arrive as explicit LaunchContext fields so every combination is testable.

Injection is command-line arguments, not config files: a loader package ships its own doorstop_config.ini / proxy DLL / run_bepinex.sh into the target at install time, and the arguments computed here override that ini at runtime.

Argv is returned as a real argv vector and is never shell-quoted — pass it to Command::args, not to a shell.

Structs§

LaunchContext
The platform facts a launch computation needs, supplied by the caller.
LaunchPlan
A fully computed launch invocation.
SteamWrapper
What a caller needs to install the wrapper script for a Linux native Steam launch, carried by LaunchPlan::steam_wrapper when that combination applies.

Enums§

HostOs
The operating system the game will run on.
LaunchMode
Launch with mods applied, or without.
LaunchProgram
The process the caller should start.
Runtime
Whether the game runs natively or under Proton/Wine.
StorePlatform
How the game is distributed, which decides what process is started.

Constants§

LOADER_SCRIPTS
The loader scripts a BepInEx/BepisLoader package may ship into the target, in precedence order. Both the resolver behind launch_plan_in and the wrapper script from wrapper_script_contents chainload the first one present, so the two agree by construction.
PRELOADER_CANDIDATES
Preloader assembly names a BepInEx package may ship, in the order r2modman lists them. The first one present in <target>/BepInEx/core wins.
WRAPPER_TARGET_FLAG
The flag that tells a generated wrapper which target directory to chainload.

Functions§

bepinex_preloader
Locates the BepInEx preloader assembly inside <target_dir>/BepInEx/core.
doorstop_version
Reads the Doorstop major version from <target_dir>/.doorstop_version, defaulting to 3 when the file is missing or unparseable.
ensure_loader_scripts_executable
Marks every LOADER_SCRIPTS entry present in target_dir executable, returning the paths whose mode this call actually changed.
has_corlibs
Whether the target ships unstripped corlibs, which need a Doorstop search-path override.
launch_plan
Computes the launch invocation for an r2modman-layout profile. See launch_plan_in.
launch_plan_in
Computes the launch invocation for target_dir.
loader_args
The loader’s own arguments for the requested mode, before any caller-supplied extras. An unrecognized loader contributes nothing rather than erroring, so a newer ecosystem schema degrades to a vanilla launch.
proxy_dll
The Wine proxy DLL a loader hooks through under Proton.
resolve_game_exe
The first of exe_names present in game_dir.
stage_destination
Where a profile-root file belongs in the game directory, or None when it is not staged at all. Pure — no filesystem access.
stage_for_launch
Stages an r2modman-layout profile’s loader files into game_dir. See stage_for_launch_in.
stage_for_launch_in
Copies the target’s root-level loader files into game_dir so the proxy sits beside the executable, returning the absolute paths written.
steam_launch_options
The string a user pastes into Steam’s launch options for a Linux native launch.
wrapper_path
Where a game’s Steam wrapper script is written.
wrapper_script_contents
Builds the POSIX shell wrapper that Steam invokes on Linux native launches.
wrapper_target_args
The arguments that make a generated wrapper chainload target_dir.
write_wrapper_script
Writes the wrapper script to script_path, marking it executable on Unix (the loader scripts fail to chainload otherwise).