fix(builder): an update ends a leftover windowless game process, and names a running one #2155

Merged
NotRexed merged 2 commits from fix/update-closes-stale-game into main 2026-11-11 05:21:04 +00:00
NotRexed commented 2026-11-11 05:09:28 +00:00 (Migrated from github.com)

From Discord tonight: after a "stuck on preparing shaders" start, a player's update stopped with

The update stopped: Could not replace G:...\bin\hookshot.exe. Close any running copy of Hookshot ...

and they had to find the hookshot.exe still running in the background (no window) themselves.

Before the installed files are replaced (make_game.py's finish step, Windows only), end_stale_games() finds the processes whose exe is in the game folder or its bin folder (Toolhelp snapshot, QueryFullProcessImageNameW):

  • No visible window (a leftover: a preparation that hung, or a game whose window closed but whose process didn't end): ended (TerminateProcess) and waited for, with a line in the build's output.
  • A visible window (a game being played): never ended. The build stops before replacing anything and names the process id to close.

Checked

  • A copy of ping.exe run windowless from a temp folder was ended; a call for another folder ended nothing.
  • test_finish_output and test_make_game_ngx pass locally. test_linux_update fails locally on Windows with or without this change (symlinks); the CI Linux run covers it.

🤖 Generated with Claude Code

From Discord tonight: after a "stuck on preparing shaders" start, a player's update stopped with > The update stopped: Could not replace G:\...\bin\hookshot.exe. Close any running copy of Hookshot ... and they had to find the `hookshot.exe` still running in the background (no window) themselves. Before the installed files are replaced (`make_game.py`'s finish step, Windows only), `end_stale_games()` finds the processes whose exe is in the game folder or its `bin` folder (Toolhelp snapshot, `QueryFullProcessImageNameW`): - **No visible window** (a leftover: a preparation that hung, or a game whose window closed but whose process didn't end): ended (`TerminateProcess`) and waited for, with a line in the build's output. - **A visible window** (a game being played): never ended. The build stops before replacing anything and names the process id to close. ### Checked - A copy of `ping.exe` run windowless from a temp folder was ended; a call for another folder ended nothing. - `test_finish_output` and `test_make_game_ngx` pass locally. `test_linux_update` fails locally on Windows with or without this change (symlinks); the CI Linux run covers it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Commenting is not possible because the repository is archived.
No description provided.