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§
- Launch
Context - The platform facts a launch computation needs, supplied by the caller.
- Launch
Plan - A fully computed launch invocation.
- Steam
Wrapper - What a caller needs to install the wrapper script for a Linux native Steam
launch, carried by
LaunchPlan::steam_wrapperwhen that combination applies.
Enums§
- HostOs
- The operating system the game will run on.
- Launch
Mode - Launch with mods applied, or without.
- Launch
Program - The process the caller should start.
- Runtime
- Whether the game runs natively or under Proton/Wine.
- Store
Platform - 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_inand the wrapper script fromwrapper_script_contentschainload 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/corewins. - 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 to3when the file is missing or unparseable. - ensure_
loader_ scripts_ executable - Marks every
LOADER_SCRIPTSentry present intarget_direxecutable, 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_namespresent ingame_dir. - stage_
destination - Where a profile-root file belongs in the game directory, or
Nonewhen it is not staged at all. Pure — no filesystem access. - stage_
for_ launch - Stages an r2modman-layout profile’s loader files into
game_dir. Seestage_for_launch_in. - stage_
for_ launch_ in - Copies the target’s root-level loader files into
game_dirso 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).