Repository navigation
grill run: renew the Battle.net sign-in and start the game in the user's own registry view - #91
Conversation
…r's own registry view A process started from a packaged (MSIX) app, such as the Claude desktop app or an editor started from inside one, reads and writes HKCU through the package's private copy, and so does everything it starts. Battle.net, the sign-in renewal and the game hand the sign-in to each other through HKCU, so grill's reg.exe calls, the Battle.net it asked to launch and the game it started could each see a different registry from the rest of the machine: tokens were lost and clients stopped at the login panel. OutsideStart starts a process through WMI (Win32_Process.Create), in the user's own context on the same desktop, and falls back to ProcessBuilder when WMI cannot start it. The renewal now runs an embedded battlenet-token.ps1 that way, hidden, and reads its outcome from a redirected output file: complete lines only, read again once the script has exited, and removed only after the script has let it go. It replaces the Kotlin polling loop; the lock and the window watcher stay. A renewal in which the app started the game but no new token appeared reports that Battle.net itself was started from such an app, and tells the user to start it from the Start menu. grill run starts the game through OutsideStart on Windows, in the client's folder as before. This is the same change as WurstScript's Run Map. AGENTS.md and the project template no longer point at a tool that is not public.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 395d691d39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Projects whose notes came from the previous template get the refresh warning.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ba1a49b5e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
After a renewal, grill read EDITOR_TOKEN through reg.exe in its own view to see the launched client replace it. Inside a packaged app whose private copy already held an EDITOR_TOKEN, that read never changed, so grill run stayed blocked for the full 120 s after the client had signed in. A small watcher script now starts outside grill's view right after the renewal, notes the renewed token before the game starts, and reports once the client replaces it. If it cannot start, grill reads the token from its own view as before.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
grill runrenews the-editorsign-in from the Battle.net app by copying the one-timeWEB_TOKENtoEDITOR_TOKEN, then starts the game. Battle.net, the renewal and the game hand the sign-in to each other throughHKCU.A process started from a packaged (MSIX) app, such as the Claude desktop app or an editor started from inside one, reads and writes
HKCUthrough the package's private copy, and so does everything it starts. Grill'sreg.execalls, the Battle.net it asked to launch and the game it started could each see a different registry from the rest of the machine. Tokens got lost, and clients stopped at the login panel.This is the same change as wurstscript/WurstScript#1629 for Run Map.
Change
OutsideStart(new) starts a process through WMI (Win32_Process.Create), in the user's own context, on the same desktop. If WMI cannot start it, it falls back toProcessBuilder.battlenet-token.ps1that way, hidden. Grill reads its outcome from a redirected output file:token-not-visible: Battle.net started the game but no new token appeared. The user is told to quit Battle.net from its tray icon and start it from the Start menu.grill runstarts the game throughOutsideStarton Windows, in the client's folder as before. Wine launches are unchanged.AGENTS.mdandtemplates/AGENTS.mdno longer point at a tool that is not public.Validation
./gradlew test: 154 tests pass.BattleNetSignInTests(18) adds tests for:java, checking that arguments with spaces, quotes and trailing backslashes, and the working directory, arrive intact.BattleNetSignIn.find().renew()succeeded in 3.3 s.grill runof a map.