feat(linux): LONGSHOT_LAUNCHER_EXE, the path a package starts the launcher with #54

Open
gab9281 wants to merge 1 commit from gab9281/LongshotLauncher:feat/flatpak-path into main
Member

Why: the Longshot Flatpak now installs this launcher's own program in /app/bin, a path that exists only inside its sandbox. The game folders' builder= stamp and the shortcuts need a path that also starts the launcher from outside, and a Flatpak launcher can't replace its own file.

What changed

  • Core/SelfUpdate.cs: SelfUpdate.StartPath. It returns LONGSHOT_LAUNCHER_EXE when a package sets it, else the AppImage (APPIMAGE), else the program. The Flatpak sets the variable to a start script that runs flatpak run.
  • App/LauncherService.cs: LauncherPath (builder=, the shortcuts, the make_game command) uses it.
  • App/LauncherService.cs: the update check offers the launcher's own update only when it was started from its own file (Program.Layout.File). The Flatpak's and dotnet run's are not, and UpdateLauncherAsync would refuse them anyway ("not started from its own file"). Flatpak updates the Flatpak's launcher.
  • README: the variable in "Environment and command line".
  • tests/launcher_core: StartPath checks: the package's path first, then the AppImage, then the program.

Testing

  • python3 -I tests/test_launcher_core.py: 675 checks passed.
  • dotnet build LongshotLauncher.slnx -c Release: 0 errors.
  • Ran inside org.freedesktop.Platform 26.08, the Flatpak's runtime, with network access: --self-check answers, the window opens, and the home lists Longshot's releases.
  • Not tested: this branch's program inside the Flatpak (it needs a release). The Flatpak side is MagicBean-Mirror/longshot-flatpak-builder#2.

🤖 Generated with Claude Code

https://claude.ai/code/session_015KgSKoUqUvce5UXG89NBgi

Why: the Longshot Flatpak now installs this launcher's own program in `/app/bin`, a path that exists only inside its sandbox. The game folders' `builder=` stamp and the shortcuts need a path that also starts the launcher from outside, and a Flatpak launcher can't replace its own file. ## What changed - `Core/SelfUpdate.cs`: `SelfUpdate.StartPath`. It returns `LONGSHOT_LAUNCHER_EXE` when a package sets it, else the AppImage (`APPIMAGE`), else the program. The Flatpak sets the variable to a start script that runs `flatpak run`. - `App/LauncherService.cs`: `LauncherPath` (`builder=`, the shortcuts, the make_game command) uses it. - `App/LauncherService.cs`: the update check offers the launcher's own update only when it was started from its own file (`Program.Layout.File`). The Flatpak's and `dotnet run`'s are not, and `UpdateLauncherAsync` would refuse them anyway ("not started from its own file"). Flatpak updates the Flatpak's launcher. - README: the variable in "Environment and command line". - `tests/launcher_core`: `StartPath` checks: the package's path first, then the AppImage, then the program. ## Testing - `python3 -I tests/test_launcher_core.py`: 675 checks passed. - `dotnet build LongshotLauncher.slnx -c Release`: 0 errors. - Ran inside org.freedesktop.Platform 26.08, the Flatpak's runtime, with network access: `--self-check` answers, the window opens, and the home lists Longshot's releases. - Not tested: this branch's program inside the Flatpak (it needs a release). The Flatpak side is MagicBean-Mirror/longshot-flatpak-builder#2. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015KgSKoUqUvce5UXG89NBgi
feat(linux): LONGSHOT_LAUNCHER_EXE, the path a package starts the launcher with
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
1bd9b19cc5
The Flatpak installs the launcher's own program in /app/bin, which exists
only inside its sandbox. The game folders' builder= stamp and the
shortcuts need a path that starts it from outside too: a package sets
LONGSHOT_LAUNCHER_EXE (the Flatpak: a script that runs flatpak run).
SelfUpdate.StartPath takes it first, then the AppImage, then the program.

A launcher not started from its own file (the Flatpak's, dotnet run) is
no longer offered its own update, which it could not put in place: the
Flatpak's updates come through Flatpak.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015KgSKoUqUvce5UXG89NBgi
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/flatpak-path:gab9281-feat/flatpak-path'
git switch 'gab9281-feat/flatpak-path'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!54
No description provided.