Repository navigation
play.ps1: exit with the child's code, and let captures through (#3, #19) - #101
Closed
xiaotu030202 wants to merge 1 commit into
Closed
xiaotu030202 wants to merge 1 commit into
xiaotu030202 wants to merge 1 commit into
Conversation
The launcher ended on `Write-Host`, and a PowerShell script that ends normally exits 0 whatever the commands inside did. It printed "Exited with 1" and the log named the failure while the process returned 0, so a failed launch counted as a successful sample in batch runs (Zettrox#3). It now exits with the child's code. A command that cannot be started at all leaves `$LASTEXITCODE` untouched, so reading it alone reports the previous command's 0 in exactly that case. `$?` says whether the call ran, and 1 stands in when it did not. `$PSScriptRoot` in the `-Exe` default is not touched here: PR Zettrox#17 fixes that and does more with it (missing-file reporting, PATH lookup), so this change stays out of its way and works with or without it merged. The launcher also cleared `VICTORY_CAPTURE`, `VICTORY_CAPTURE_FRAMES`, `VICTORY_DUMP_TARGETS` and `VICTORY_KEYS` unconditionally, so passing the diagnostics executable with `-Exe` still could not capture or script input (Zettrox#19). They are opt-in now: `-Capture`, `-Keys`, or `-KeepScriptedInput` for both. The default is unchanged — a normal run captures nothing and presses nothing. Measured on Windows 11, Rust 1.98.1 (pinned), release build, no game files: play.ps1 -Game <missing exe> -Exe <the built one> -> 1 (was 0) play.ps1 -Game <missing exe> -Exe <not there> -> 1 and the switches, probed inside the script after the clearing step: (none) CAPTURE= FRAMES= DUMP= KEYS= -Capture CAPTURE=set FRAMES=set DUMP=set KEYS= -Keys CAPTURE= FRAMES= DUMP= KEYS=set -KeepScriptedInput CAPTURE=set FRAMES=set DUMP=set KEYS=set A path with spaces reaches the child intact: `-Game "…\GTA 6\game scarlett master.exe"` produces the same `malformed image` line from `victory.exe` as running it directly does, so Zettrox#4's truncation does not reproduce on this build. README: the launcher's exit code, and the three switches with both the switch and the direct diagnostics launch.
xiaotu030202
force-pushed
the
play-exit-code-and-captures
branch
from
November 25, 2026 11:28
1c02f2d to
6f2d470
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closing this: #15 and #22 already do both halves, more precisely, and I did not check the open pull requests before writing it.
Launcher: propagate the native process exit code, +3/−1-Capture/-Keysswitches + README section (#19)Docs: show a direct launch for captures and scripted input, +17/−1The one thing #15 and #22 do not cover
$?-guarded exit code. #15 reads$LASTEXITCODEafter the pipeline, which is right for a child that ran and failed. A command that cannot be started at all leaves$LASTEXITCODEuntouched, so it reports the previous command's value — and #3's own reproduction is.\target\release\victory.exe run $missing, which is that case whenever-Exedoes not resolve.With #17 (
-Exeresolution, and it exits 1 when nothing is found) and #53 (directory errors) merged, that window closes from the other side, so #15 alone is fine. Noting it rather than asking for a change.What I verified, in case it helps whoever reviews #15
Windows 11, Rust 1.98.1 (pinned), release build, no game files:
And the switches, probed inside the script right after the clearing step, before I saw #22:
Also: #4 does not reproduce on
90b529fI ran a path with spaces through the launcher and compared it against a direct run:
Both reach
victory.exewith the same argument, so the truncation in #4 is the-Exedefault rather than argument splitting — which is what that thread concluded and what #17 fixes. Worth saying so on #4 once #17 lands.Sorry for the duplicate. #100 (opcode coverage) is the one from me that is not already in flight.