HLE: honor the requested executable on relaunch #455
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/455"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-24T03:37:26Z.
What
runtime::set_image_pathmakes the title image path absolute, butrelaunch_argssearched the raw command line for that exact string. Aftervictory run game.exe --execute, anXLaunchNewGamerequest for a differentexecutable found no match and silently reran
game.exe. This normalises thelaunch argument the same way
runtimedoes before replacing it, so relativestartup paths work and the requested executable is used.
The same helper split the title's arguments with
split_whitespace, whichbroke quoted paths from the title's configuration. A small splitter keeps
quoted strings together, including empty arguments. The child process gets
those as separate argv entries;
lifecycle::relaunchalready passes themthrough with
Command::argsand does not re-split.An AI tool wrote part of this change.
Tested
cargo test --workspace: 165 passed, 0 failed, 3 ignored. The existing argv test still passes; a new regression uses a relative startup path, a different target, and a quoted path plus an empty argument.cargo check --target x86_64-pc-windows-gnu --workspace --testspasses. No Windows host here, so the spawned child was not run.cargo xtask policypasses (150 files ok). No game files or data from them were added.XLaunchNewGamecall; the regression is at the argument-building layer.Checklist
cargo xtask policypasses. No game files or data from them were added.Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T05:47:23Z.
Review: CHANGES_REQUESTED
Tested
1c129daon Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (248 passed, 0 failed; this branch is based on an older main, hence the lower count).The absolute-path match in
relaunch_argsis a good fix. One bug insplit_args, though:crates/victory-hle/src/modules/xgame.rs,split_args:'is treated as a quote character. Windows command lines (CommandLineToArgvW, MSVCRT) quote only with". An apostrophe inside an argument now starts a quoted run that swallows the following whitespace:-name=O'Brien -ygives one argument-name=OBrien -y.split_whitespacebefore, it gave-name=O'Brienand-y, so this is a regression for any title argument containing an apostrophe.Suggested fix: drop
'\''from both quote arms and only toggle on", and addO'Briento the test. Following theCommandLineToArgvWbackslash rules (\"is a literal quote,2nbackslashes before"becomen) would also keep paths like"C:\dir\\"intact.Smaller points:
#[cfg(windows)]/#[cfg(not(windows))]split inlaunch_new_gameis not mentioned in the description. On non-Windows the function now returns instead of parking, which changes its contract. It would be clearer as its own commit with a reason.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-24T07:30:04Z.
Rebased on current main. Fixed split_args to quote only on double quotes; apostrophes are ordinary text. Added -name=O'Brien to the regression. New head
a9bc94e.Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T09:20:06Z.
Review: APPROVED
Re-tested
a9bc94eon Windows 11, RTX 5070, MSVC:cargo test --workspace --exclude victory-shaderpasses (196 passed, 0 failed), including the extended relaunch test. I ranvictory-shaderseparately single-threaded, since its parallel GPU tests hang, which is unrelated to this change.Thanks, this fixes what I raised.
split_argsnow quotes only with", and the test covers-name=O'Brien. The branch is rebased onto current main, so the full suite runs.Not blocking, from my first review: there are still no
CommandLineToArgvWbackslash rules (\"), and the#[cfg(windows)]split inlaunch_new_gameis still undescribed. Neither affects Windows behaviour. Approving.AI-assisted (Claude Code).