victory: a menu when opened from Explorer, instead of help that closes at once #959

Open
EduBertozzi wants to merge 7 commits from upstream-pr/959 into main
EduBertozzi commented 2026-11-24 14:28:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by EduBertozzi on 2026-11-24T14:28:12Z.


What

When victory.exe is opened from Explorer (no arguments, in a console of its own), it now shows a small menu. Before, clap's usage flashed and the window closed at once, which is the confusion in #527. Every command-line use is unchanged. The menu shows only when the process has its console to itself (GetConsoleProcessList), or when VICTORY_MENU=1 is set.

The menu, then 3 (Check this PC), on Windows 10 + GTX 1060

  • 1 Run a game: drag the title's .exe onto the window or type its path. The path is cleaned of quotes and PowerShell's & '...'. The game runs as a child victory run <exe> --execute in the same console, so a crash or an exit of the title leaves the menu up. The menu then shows how the run ended (the exit code, in hex for an NTSTATUS such as 0xC0000005) and waits for Enter. Ctrl+C stops the run, not the menu.

  • 2 Run again: the last game, remembered in the data folder while the file still exists.

  • 3 Check this PC: what most "can't run" issues ask, each line with a one-line hint:

    • the Windows build, with the SM 6.5 limit of the in-box D3D12 on Windows 10 (#84, #175);
    • AVX2;
    • the GPU's name and driver (DXGI);
    • shader model 6.6;
    • mesh shaders (#3);
    • wave size (#578, #778);
    • the game, data and cache folders, with the asset-policy check.

    C then Enter copies the result as plain text for a GitHub report, with the profile folder written as %USERPROFILE%.

  • 4 Open the data folder (saves, crashes.log).

  • S Set the game folder: writes [paths].game_dir to the config file the tools read (VICTORY_CONFIG, else victory.toml beside a double-clicked victory.exe). A dropped .exe stands for its folder. Only that line changes, so comments and other keys stay. A folder inside the repository is refused with the asset-policy message.

  • K Keyboard controls: the keyboard's stand-in pad, as gameinput.rs maps it and the README lists it.

  • M Console: switches Series X / Series S for runs (--console). The choice is remembered.

S, K and M follow @sahajiscoding's launcher in #1330.

The colours are an original 24-bit gradient, nothing from the title. NO_COLOR turns them off, CLICOLOR_FORCE=1 turns them on, and the menu stays plain where the console has no VT support. Hints wrap to the console width. Proposed and discussed in #910. @MichaelSmithAI's follow-up from there is included: on Windows 10, the Agility hint shows only when SM 6.6 is missing.

The app gains a [target.'cfg(windows)'.dependencies] block. It enables the windows-sys features Console, DataExchange, Memory and Registry, and pulls in windows with Direct3D12 and Dxgi. The test-only dependency is tempfile.

Tested

Native Windows 10 22H2 (19045), GTX 1060 6 GB, MSVC:

  • cargo test -p victory: 12 menu tests. They cover:

    • choices;
    • path cleaning;
    • the remembered game;
    • the check's verdicts on Windows 10 and 11, with and without SM 6.6;
    • wrapping;
    • colours on and off;
    • the child command and its exit messages;
    • the copied report;
    • the config edit (empty file, the example file, with and without [paths], apostrophes, CRLF), each read back with toml;
    • the console model and its memory;
    • the keys table.
  • cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: clean.

  • I drove the built victory.exe with VICTORY_MENU=1:

    • The check at 80 columns.
    • A file that isn't a game: the child stops with malformed image, and the menu shows exit code 1 and carries on.
    • An invalid choice.
    • Opening the data folder.
    • Copying the report: the pasted text keeps the ✓/✗ marks and holds no profile path.
  • Merged with #175 plus the 1.620.2 runtime beside the executable, the same check reports SM 6.6 and Windows 10 as ready, with no conflicts between the two.

  • @MichaelSmithAI ran the menu and CLI paths under Wine (#910).

  • Detection: started with no arguments in a console of its own (Start-Process, as Explorer starts it), it stays up waiting at the menu. Started with no arguments from an existing PowerShell console, it prints clap's usage and exits 2, as before.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6584054960 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/959). Originally posted by [EduBertozzi](https://github.com/EduBertozzi) on 2026-11-24T14:28:12Z. --- ## What When `victory.exe` is opened from Explorer (no arguments, in a console of its own), it now shows a small menu. Before, clap's usage flashed and the window closed at once, which is the confusion in #527. Every command-line use is unchanged. The menu shows only when the process has its console to itself (`GetConsoleProcessList`), or when `VICTORY_MENU=1` is set. ![The menu, then 3 (Check this PC), on Windows 10 + GTX 1060](https://raw.githubusercontent.com/EduBertozzi/VIctory/ux/screenshots/launcher-menu.png) - **1 Run a game**: drag the title's `.exe` onto the window or type its path. The path is cleaned of quotes and PowerShell's `& '...'`. The game runs as a child `victory run <exe> --execute` in the same console, so a crash or an exit of the title leaves the menu up. The menu then shows how the run ended (the exit code, in hex for an NTSTATUS such as `0xC0000005`) and waits for Enter. Ctrl+C stops the run, not the menu. - **2 Run again**: the last game, remembered in the data folder while the file still exists. - **3 Check this PC**: what most "can't run" issues ask, each line with a one-line hint: - the Windows build, with the SM 6.5 limit of the in-box D3D12 on Windows 10 (#84, #175); - AVX2; - the GPU's name and driver (DXGI); - shader model 6.6; - mesh shaders (#3); - wave size (#578, #778); - the game, data and cache folders, with the asset-policy check. `C` then Enter copies the result as plain text for a GitHub report, with the profile folder written as `%USERPROFILE%`. - **4 Open the data folder** (saves, `crashes.log`). - **S Set the game folder**: writes `[paths].game_dir` to the config file the tools read (`VICTORY_CONFIG`, else `victory.toml` beside a double-clicked `victory.exe`). A dropped `.exe` stands for its folder. Only that line changes, so comments and other keys stay. A folder inside the repository is refused with the asset-policy message. - **K Keyboard controls**: the keyboard's stand-in pad, as `gameinput.rs` maps it and the README lists it. - **M Console**: switches Series X / Series S for runs (`--console`). The choice is remembered. S, K and M follow @sahajiscoding's launcher in #1330. The colours are an original 24-bit gradient, nothing from the title. `NO_COLOR` turns them off, `CLICOLOR_FORCE=1` turns them on, and the menu stays plain where the console has no VT support. Hints wrap to the console width. Proposed and discussed in #910. @MichaelSmithAI's follow-up from there is included: on Windows 10, the Agility hint shows only when SM 6.6 is missing. The app gains a `[target.'cfg(windows)'.dependencies]` block. It enables the `windows-sys` features Console, DataExchange, Memory and Registry, and pulls in `windows` with Direct3D12 and Dxgi. The test-only dependency is `tempfile`. ## Tested Native Windows 10 22H2 (19045), GTX 1060 6 GB, MSVC: - `cargo test -p victory`: 12 menu tests. They cover: - choices; - path cleaning; - the remembered game; - the check's verdicts on Windows 10 and 11, with and without SM 6.6; - wrapping; - colours on and off; - the child command and its exit messages; - the copied report; - the config edit (empty file, the example file, with and without `[paths]`, apostrophes, CRLF), each read back with `toml`; - the console model and its memory; - the keys table. - `cargo clippy --workspace --all-targets --locked -- -D warnings`, with and without `--all-features`: clean. - I drove the built `victory.exe` with `VICTORY_MENU=1`: - The check at 80 columns. - A file that isn't a game: the child stops with `malformed image`, and the menu shows exit code 1 and carries on. - An invalid choice. - Opening the data folder. - Copying the report: the pasted text keeps the ✓/✗ marks and holds no profile path. - Merged with #175 plus the 1.620.2 runtime beside the executable, the same check reports SM 6.6 and Windows 10 as ready, with no conflicts between the two. - @MichaelSmithAI ran the menu and CLI paths under Wine (#910). - Detection: started with no arguments in a console of its own (`Start-Process`, as Explorer starts it), it stays up waiting at the menu. Started with no arguments from an existing PowerShell console, it prints clap's usage and exits 2, as before. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Zipettte commented 2026-11-24 17:04:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T16:30:37Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at ea3af37: cargo test -p victory passes, 10 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137776886 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/959#issuecomment-7137776886). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T16:30:37Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at ea3af37: `cargo test -p victory` passes, 10 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Marvisak commented 2026-11-25 01:07:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:29:48Z.


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: Cargo.lock, apps/victory/src/main.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148568932 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/959#issuecomment-7148568932). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:29:48Z. --- <!-- victory-triage v1 head=6614cc26b7e4b3b33b810392a0b2587dcb982391 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `Cargo.lock`, `apps/victory/src/main.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
denkencar-sketch commented 2026-11-25 08:06:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by denkencar-sketch on 2026-11-25T07:33:25Z.


Tried this at head 6614cc2 on Windows 11 (build 26200), Radeon 8060S. It builds, the 12 menu tests pass, and VICTORY_MENU=1 with Check this PC reports SM 6.6, mesh shaders and waves up to 64 lanes. Thanks for this.

One bug in S (Set the game folder), in set_game_dir:

It finds the table with l.trim() == "[paths]". A header that is valid TOML but not exactly that string is not found, so the function appends a second [paths] table and the file no longer parses (duplicate table).

Reproduced by calling set_game_dir(text, Path::new("C:\\new")) and parsing the result as toml::Table:

input header result
[paths] # where things are (then game_dir = 'D:\old') invalid: [paths] appears twice
[ paths ] invalid: same
[paths] followed by a tab ok

Output for the first case:

[paths] # where things are
game_dir = 'D:\old'

[paths]
game_dir = 'C:\new'

Any tool that then loads the config is handed invalid TOML.

Possible fix: recognise the header by stripping a trailing # comment and trimming inside the brackets before comparing (and the same for the header closure that finds the end of the table), or edit the value with the toml crate, which is already a dev-dependency here. A test with the two headers above would cover it.

Two smaller notes, not confirmed as bugs:

  • copy_to_clipboard opens the clipboard with a null owner, then calls EmptyClipboard. The OpenClipboard docs say that makes SetClipboardData fail; in practice that pattern often works, but passing GetConsoleWindow() as owner would be safer.
  • adapter() names EnumAdapters1(0), while gpu() uses Host::new(false) (default device, and VICTORY_WARP=1 switches it to WARP). On a PC with two GPUs, or with VICTORY_WARP set, the name and the shader/wave lines could describe different adapters. Same adapter on a single-GPU PC.

Not tried: Explorer double-click detection, the clipboard copy itself, or running a game from the menu.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155991532 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/959#issuecomment-7155991532). Originally posted by [denkencar-sketch](https://github.com/denkencar-sketch) on 2026-11-25T07:33:25Z. --- Tried this at head `6614cc2` on Windows 11 (build 26200), Radeon 8060S. It builds, the 12 `menu` tests pass, and `VICTORY_MENU=1` with **Check this PC** reports SM 6.6, mesh shaders and waves up to 64 lanes. Thanks for this. One bug in **S (Set the game folder)**, in `set_game_dir`: It finds the table with `l.trim() == "[paths]"`. A header that is valid TOML but not exactly that string is not found, so the function appends a second `[paths]` table and the file no longer parses (duplicate table). Reproduced by calling `set_game_dir(text, Path::new("C:\\new"))` and parsing the result as `toml::Table`: | input header | result | |---|---| | `[paths] # where things are` (then `game_dir = 'D:\old'`) | invalid: `[paths]` appears twice | | `[ paths ]` | invalid: same | | `[paths]` followed by a tab | ok | Output for the first case: ``` [paths] # where things are game_dir = 'D:\old' [paths] game_dir = 'C:\new' ``` Any tool that then loads the config is handed invalid TOML. Possible fix: recognise the header by stripping a trailing `#` comment and trimming inside the brackets before comparing (and the same for the `header` closure that finds the end of the table), or edit the value with the `toml` crate, which is already a dev-dependency here. A test with the two headers above would cover it. Two smaller notes, not confirmed as bugs: - `copy_to_clipboard` opens the clipboard with a null owner, then calls `EmptyClipboard`. The `OpenClipboard` docs say that makes `SetClipboardData` fail; in practice that pattern often works, but passing `GetConsoleWindow()` as owner would be safer. - `adapter()` names `EnumAdapters1(0)`, while `gpu()` uses `Host::new(false)` (default device, and `VICTORY_WARP=1` switches it to WARP). On a PC with two GPUs, or with `VICTORY_WARP` set, the name and the shader/wave lines could describe different adapters. Same adapter on a single-GPU PC. Not tried: Explorer double-click detection, the clipboard copy itself, or running a game from the menu. AI-assisted.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/959:upstream-pr/959'
git switch 'upstream-pr/959'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/959'
git switch 'upstream-pr/959'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/959'
git switch 'upstream-pr/959'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/959'
git switch 'main'
git merge --squash 'upstream-pr/959'
git switch 'main'
git merge --ff-only 'upstream-pr/959'
git switch 'main'
git merge 'upstream-pr/959'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!959
No description provided.