fix(launcher): play a game in the game folder itself, beside its renderer, not only in bin/ #70

Merged
HumanBean merged 2 commits from HumanBean/LongshotLauncher:fix/game-folder-root into main 2026-11-14 20:53:23 +00:00
Owner

A version whose game sits in the game folder itself, not in bin/, shows as not built and can't be played (#53). This takes over Anarkkie's #63, with one fix on top. Anarkkie's branch doesn't allow maintainer edits, so I couldn't push the fix there.

Fixes #53.

What changed

  • Core/GameFolder.cs (Anarkkie, #63): ExePath also recognizes longshot[.exe] in the folder itself, but only when its renderer (longshot_vk.dll / longshot_vk.so) is beside it. That matches nx2/make_game.py:
    • With the setup, it installs the setup as the folder's longshot[.exe], puts the game in bin/ and removes the renderer from the folder.
    • Without the setup, the game and its renderer stay in the folder.
    • So a setup left on its own still can't enable Play.
  • The fix on top (one commit): when both are there, the folder's own game wins. #63 preferred bin/. But a build without the setup into a folder that was packaged before leaves the older game in bin/, because make_game doesn't touch bin/ then. The launcher would have quietly started that old version. A packaged build takes the renderer out of the folder, so a renderer in the folder means the last build put the game there.
  • tests/launcher_core/Program.cs: GameFolderChecks walks one folder through each layout on both systems:
    • setup only;
    • packaged;
    • rebuilt without the setup over a packaged folder (the new case);
    • packaged again;
    • no bin/ at all;
    • empty.
  • Left out of #63: docs/tested-configurations.md. It's a record of one test run and belongs in the PR, which has it.

Open question

The reporter of #53 built with the launcher on v3.0.0-rc.3, so make_game found no LongshotBuilder-Setup.exe beside its tools. Something may have removed it, possibly an antivirus. This PR makes such folders playable. Whether make_game should say the setup is missing is a Longshot question, not handled here.

Testing

  • python -I tests/test_launcher_core.py --strict --longshot <Longshot main>: 989 checks passed (Linux, .NET 10.0.404).
  • python -I tests/test_release.py: 28 OK.
  • With #71 (#64's replacement) merged in too: 1018 checks passed.
  • dotnet build LongshotLauncher.slnx -c Release -p:RestoreLockedMode=true: 0 warnings, 0 errors.
  • Anarkkie played both layouts on Windows 11 for #63 (details there). I haven't run the new case in a real game folder, only in the checks.

Co-authored with Anarkkie (#63).

A version whose game sits in the game folder itself, not in `bin/`, shows as not built and can't be played (#53). This takes over Anarkkie's #63, with one fix on top. Anarkkie's branch doesn't allow maintainer edits, so I couldn't push the fix there. Fixes #53. ## What changed - `Core/GameFolder.cs` (Anarkkie, #63): `ExePath` also recognizes `longshot[.exe]` in the folder itself, but only when its renderer (`longshot_vk.dll` / `longshot_vk.so`) is beside it. That matches `nx2/make_game.py`: - With the setup, it installs the setup as the folder's `longshot[.exe]`, puts the game in `bin/` and removes the renderer from the folder. - Without the setup, the game and its renderer stay in the folder. - So a setup left on its own still can't enable Play. - **The fix on top (one commit):** when both are there, the folder's own game wins. #63 preferred `bin/`. But a build without the setup into a folder that was packaged before leaves the older game in `bin/`, because make_game doesn't touch `bin/` then. The launcher would have quietly started that old version. A packaged build takes the renderer out of the folder, so a renderer in the folder means the last build put the game there. - `tests/launcher_core/Program.cs`: `GameFolderChecks` walks one folder through each layout on both systems: - setup only; - packaged; - rebuilt without the setup over a packaged folder (the new case); - packaged again; - no `bin/` at all; - empty. - Left out of #63: `docs/tested-configurations.md`. It's a record of one test run and belongs in the PR, which has it. ## Open question The reporter of #53 built with the launcher on v3.0.0-rc.3, so make_game found no `LongshotBuilder-Setup.exe` beside its tools. Something may have removed it, possibly an antivirus. This PR makes such folders playable. Whether make_game should say the setup is missing is a Longshot question, not handled here. ## Testing - `python -I tests/test_launcher_core.py --strict --longshot <Longshot main>`: 989 checks passed (Linux, .NET 10.0.404). - `python -I tests/test_release.py`: 28 OK. - With #71 (#64's replacement) merged in too: 1018 checks passed. - `dotnet build LongshotLauncher.slnx -c Release -p:RestoreLockedMode=true`: 0 warnings, 0 errors. - Anarkkie played both layouts on Windows 11 for #63 (details there). I haven't run the new case in a real game folder, only in the checks. Co-authored with Anarkkie (#63).
fix(launcher): a game left in the folder by the last build is played, not an older one in bin/
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
1816405b8e
A packaged build puts the game in bin/ and takes the renderer out of the folder itself; a build without the setup leaves
the game and its renderer in the folder and does not touch bin/. So the renderer in the folder means the last build left
the game there, and an older game may still be in bin/ from a packaged build before it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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!70
No description provided.