Skip to content

Ask for the program when the guess can't tell the game from a helper - #572

Merged
elripalda merged 5 commits into
elripalda:mainfrom
thehobbit85:claude/fix-ask-for-unclear-game-program
Nov 25, 2026
Merged

elripalda merged 5 commits into
elripalda:mainfrom
thehobbit85:claude/fix-ask-for-unclear-game-program

Conversation

@thehobbit85

Copy link
Copy Markdown
Contributor

What this changes

When a release doesn't say which program starts the game (no start.program, no catalog startup entry), the launcher guesses by name, size and place. If no program shares a word with the game's names, the biggest one wins, so a helper the game starts can be launched instead of the game, with no warning. This is the same failure that #347 and #348 handle by adding one program name each to a list. This PR fixes the cause generally, without naming any game or program.

  • Programs: find_game_exe now leaves the choice to the player, once, when the best program matches none of the game's names, isn't a launch script, and another program that isn't a tool is left. A program named for the game, a launch script, or the only real program is still picked as before. The player's pick is kept as it always was.
  • Release files: release archives get the same tool words programs already had (TOOL_WORDS: translator, shader, server, patcher, converter, ...). A file named for a tool is no longer taken as the game's build when the build is guessed. A word that every build of the release shares counts as the game's own name, so a game called "Shader Quest" still installs. A file pattern from the catalog is still used as it is: a wrong pattern is the catalog's to fix.
  • Existing installs: EXE_RULES goes from 21 to 22, so older automatic picks are checked again on the next Play. If the old pick is only a guess of this kind, the player is asked once, unless the game has already played for two minutes with it. Programs the player picked are never changed.

The trade-off: a release with several programs, none named like the game, now asks the player once instead of guessing. No recomplauncher.json field changes. A developer can still avoid the question by naming the program in start.program.

Suggested patch-notes line: When the launcher can't tell which program starts a game, it asks you to pick it once, instead of guessing.

How you tested it

Run on macOS only, against d5b054d. All tests use synthetic files, with no game files.

  • Rust: 1,165 passed, 1 ignored. UI: 977 passed, 11 skipped. Syntax checks and git diff --check pass.

  • 13 new tests. Six failed on main before the change: two programs that don't name the game return no guess, the unclear guess is reported, a tool archive and a server archive aren't the Linux build or a choice, and an unclear old pick not played long is asked again. The other seven are controls that pass before and after: a named program beside helpers, a lone program, a program beside only tools, a tool word in the game's own name, a catalog pattern naming a tool archive, an old guess played a while, and a clear pick.

  • None of the existing program or release-file tests changed their expected result. As a stricter check, applying the new rule to find_exe itself as well still changed none of them. That check was reverted.

  • npm test passes

  • node --test tests/*.test.cjs passes

  • Tried it in the launcher (npm run dev)

Checklist

  • One change per pull request
  • No version bump or patch notes (those are done at release time)
  • Does not change what developers can write in recomplauncher.json

When a release doesn't say which program starts the game, the launcher guessed by name, size and place. If no program named the game, the biggest one won, so a helper the game starts could be launched instead with no warning. That guess is now left to the player, once, whenever another program that isn't a tool is left. A program named for the game, a launch script, or the only real program is still picked as before.

Release files get the same tool words as programs: an archive named for a translator, shader builder, server or another tool is no longer taken as the game's build. A word every build of the release shares is the game's own name and doesn't count. A file pattern from the catalog is still used as it is.

EXE_RULES goes to 22, so older automatic picks are checked again on the next Play. One that is only a guess is asked about once, unless the game has already played for two minutes with it. Programs the player picked stay.
@Xarishark Xarishark self-assigned this Nov 25, 2026
Among what a list's pattern matches, a file named for a tool (a shader translator, a server) is left out when the game's own file is there too. A pattern that matches only a tool's file, such as a patch, is still used as it is.
An install an older version left on a guess between two programs that don't name the game: played briefly, its program is cleared so the player is asked; played a while, it stays; the player's own pick is never looked at again.
Without start.program and no program named like the game, players are asked once which program starts it; a tool or server file says so in its name so it isn't taken for the game's build.
A Mac counts a file as a program only when it's a Mach-O program or a script, so the test's made-up programs open with #! and the guess between them is seen there too.

@Xarishark Xarishark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All notes resolved and CI passed. Approving.

@elripalda
elripalda merged commit f7bd700 into elripalda:main Nov 25, 2026
6 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.

3 participants