Skip to content

Start a .NET game through its release's Linux start script - #256

Merged
elripalda merged 2 commits into
elripalda:mainfrom
Element20Three:fix/linux-profile-start-script
Nov 17, 2026
Merged

elripalda merged 2 commits into
elripalda:mainfrom
Element20Three:fix/linux-profile-start-script

Conversation

@Element20Three

Copy link
Copy Markdown
Contributor

What this changes

Fixes #255.

On Linux, Play takes the game's boot profile first. For a .NET release, the profile's Windows program (sotn.exe) maps to the native twin beside it (native_twin → sotn), which is the app host. The app host looks for the runtime only where .NET put it system-wide; when the player's runtime is in ~/.dotnet, it stops at once with code 131 and "You must install .NET to run this application."

The release's own run.sh finds that runtime, exports DOTNET_ROOT and PATH, then execs the host. #214 made the installer pick run.sh (and bumped EXE_RULES to 21), but the profile path still started the host, so g.exe = run.sh was bypassed.

Profile::program_for now checks the program it resolves. When it is a .NET app host (<name>.runtimeconfig.json beside it) and the release has a Linux start script (run.sh, start.sh, <name>.sh, launcher.sh, play.sh), Play starts the script. This covers a profile that names the Windows program and one that names the Linux host.

A native twin without a runtimeconfig is still itself, so SuperMetroidSNESRecomp.exe keeps resolving to its native ELF (checked against the installed release, which has no runtimeconfig). Prepare::program_in (a build tool's program) and macOS are untouched.

How you tested it

  • npm test passes (654 passed, 1 ignored)
  • node --test tests/*.test.cjs passes (280 passed)
  • Tried it in the launcher (npm run dev)

The new Rust test a_dotnet_app_host_starts_through_the_releases_script builds the reported layout — the sotn app host, sotn.runtimeconfig.json, and run.sh — and checks that both sotn.exe and sotn start through run.sh. It also checks that without the script the host is still used, and that a native build stays itself when a run.sh sits beside it.

The reported log shows DOTNET_ROOT = <not set> even though run.sh sets it before starting the host, which matches the profile path starting sotn directly. The installed folder matches the test layout: sotn is an x86-64 ELF app host with sotn.runtimeconfig.json and run.sh beside it.

Checklist

  • One change per pull request
  • No version bump or patch notes (those are done at release time)
  • Not a recomplauncher.json change, so no schema or docs update

A game whose boot profile names a Windows program is started by the native
twin beside it. For a .NET release that twin is the app host, which looks for
the runtime only where .NET put it system-wide and exits at once with code 131
when the player's runtime lives in ~/.dotnet. The release ships run.sh to find
that runtime and set DOTNET_ROOT, but Play never reached it: the profile's
program won over the game's selected exe.

When the program a profile resolves to is a .NET app host
(<name>.runtimeconfig.json beside it), Play now starts the release's Linux
start script instead. A native build without a runtimeconfig is still itself.

Fixes elripalda#255.
Resolve profile.rs: use named_program for the start program and keep the .NET app host's Linux start-script handoff.
@elripalda
elripalda merged commit a9d590b into elripalda:main Nov 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Play starts a .NET app host directly instead of its Linux start script when the boot profile names the Windows program

2 participants