Linux/Proton: restart victory.exe directly without PowerShell (Fixes #1954) #2434
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2434"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by steven-seagull27 on 2026-11-29T13:00:08Z.
Fixes #1954
Summary
Menu::restart_asincrates/victory-gpu/src/host/menu.rsunconditionally spawnedpowershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Start-Sleep 3; ... & $env:VICTORY_MENU_PLAY ..."before callingTerminateProcess. Under Linux/Proton (Wine),powershell.exeis either absent or Wine's stub executable (whichCreateProcessWstarts successfully and which then exits immediately without running anything — matchingdocs/linux-proton.mdand #1954). As a result, both the one-time warmup restart (Menu::warmup) and F1 settings restarts closed the game without relaunchingvictory.exe..exerelaunch without PowerShell (crates/victory-gpu/src/host/menu.rs):ntdll.dll'swine_get_version(on_wine()), matchingapps/victory/src/main.rsandcrates/victory-hle/src/modules/xmem.rs.parse_menu_argsto parseVICTORY_MENU_ARGS(single-quoted PowerShell tokens, escaped'', and$env:VICTORY_MENU_EXEexpansion) into rawOsStringarguments while rejecting unclosed quotes or unquoted shell operators.CommandLineToArgvW-compliant Windows command-line quoting (build_windows_command_line) and sorted UTF-16 environment block construction (build_env_block,CREATE_UNICODE_ENVIRONMENT) forCreateProcessWwithCREATE_NEW_CONSOLE.plan_restartstrategy selection:.exetargets directly without PowerShell under Wine/Proton (never hitting Wine's stubpowershell.exe), when restartingvictory.exeitself, and forown_command(save import)..ps1launcher scripts on native Windows (and uses PowerShell with direct-spawn fallback for third-party.exelaunchers on native Windows)..exelauncher or unparseable args cannot be restarted under Wine/Proton.apps/victory/src/main.rs,apps/victory/src/play.rs):VICTORY_RESTART_DELAY_SECS=3and the requestedThenoverride (VICTORY_PRELOAD=1/VICTORY_CLEAR_SHADERS=1, clearing stale flags) directly in the child environment block.main()(before GPU/runtime initialization, address-space reservation, or child process spawns),victory.exereads and immediately removesVICTORY_RESTART_DELAY_SECS(clamped to 30s), sleeps so the previous process exits and releases GPU/file locks cleanly, and holds the console window on startup error (play::hold_window) when restarted directly.Verification (synthetic tests only)
cargo test --locked -j 3 -p victory-gpu --lib -- menu --nocapture --test-threads=1— 19 passed, 0 failed:parse_menu_args_handles_quotes_unicode_and_env_expansion(spaces, Unicode, typographic apostrophes#563, escaped', quotes, backslashes,$env:VICTORY_MENU_EXE, invalid syntax rejection)windows_command_line_round_trips_through_command_line_to_argv_w(Win32CommandLineToArgvWround-trip)build_env_block_applies_case_insensitive_overrides_and_removals(Then::Play/Preload/ClearShaders,VICTORY_RESTART_DELAY_SECS=3, stale flag clearing)plan_restart_selects_direct_powershell_fallback_and_unavailable(Wine/Proton vs native Windows,.exevs.ps1,own_command, menu glyph/width checks)direct_restart_spawns_exe_without_powershell_and_passes_env_and_args(end-to-endCreateProcessWdirect restart verifying cwd, args with spaces/Unicode/typographic apostrophes/quotes/backslashes,VICTORY_RESTART_DELAY_SECS=3,VICTORY_CLEAR_SHADERS=1, and staleVICTORY_PRELOADremoval)preload_restart_preserves_paths_and_working_directory(existing.ps1PowerShell path preserved)cargo test --locked -j 3 -p victory --bin victory -- --nocapture— 80 passed, 0 failed (includingrestart_delay_parses_clamps_and_rejects_invalid_values,take_restart_delay_clears_env_so_children_do_not_inherit_it, and all existingplay::tests::*).cargo clippy --locked -j 3 -p victory-gpu -p victory --bins --tests— 0 warnings in touched files.git diff --check— clean.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by steven-seagull27 on 2026-11-30T18:33:36Z.
Rebased cleanly onto latest
main(e1251c31, including#4067where Steam launchesvictory.exe playdirectly andplay-nvidia.ps1). Re-verifiedvictory-gpumenu tests,victorybinary tests, Clippy, andxtask policy --staged.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.