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

Open
github-bot wants to merge 7 commits from github-bot/gh-959 into main AGit
Owner

@⁠EduBertozzi on GitHub · 2026-11-24 14:28 UTC · original
EduBertozzi:ux/launcher-menu → main · +1386 −0 · 4 files · 7 commits · open

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

**@⁠EduBertozzi** on GitHub · 2026-11-24 14:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/959) `EduBertozzi:ux/launcher-menu` → `main` · +1386 −0 · 4 files · 7 commits · open ## 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)
Double-clicking victory.exe printed clap's help in a console window that
closed before it could be read (#527). Started with no arguments in a
console of its own (`GetConsoleProcessList` gives one process), or with
VICTORY_MENU=1, it now shows a menu:

1. Run a game: drag the title's .exe onto the window, or type or paste
   its path. Quotes and PowerShell's `& '...'` are taken off. It runs as
   `victory run <exe> --execute` would.
2. Run again: the last game run from the menu, remembered in the data
   folder while the file is still there.
3. Check this PC, in two sections with a mark and a hint per line:
   * This PC: the Windows build (Windows 10's built-in D3D12 stops at
     SM 6.5, and the hint says whether a D3D12\ folder sits beside the
     exe), AVX2, and what a run of this executable gets from the GPU:
     SM 6.6, mesh shaders, the widest wave.
   * Paths: the game, data and cache folders.
4. Open the data folder (saves, crashes.log) in Explorer.

After a run, or a run that stops with an error, the window waits for
Enter so the last lines can be read. A wrong key shows what to type.

Colours: a sunset gradient of VIctory's own (dusk blue, violet, orchid,
pink, peach, amber) for the name and its horizon line, and marks in the
same palette. Nothing of the title's. Virtual-terminal sequences are
turned on in the console; NO_COLOR turns colour off, CLICOLOR_FORCE=1 on.
With arguments, or in a console another program already uses (cmd,
PowerShell, a terminal), nothing changes.

Tests: dragged and pasted paths, answers (and a byte-order mark before
piped input), the remembered game, the check's lines on Windows 10 with a
32-lane GPU without mesh shaders and on Windows 11 without SM 6.6, the
gradient, plain output without colour, and the "run again" line. A piped
run of check / wrong key / bad path / quit printed what's expected.
Dependencies: windows-sys (console, registry) and windows (D3D12 feature
queries) for the app, both already in the workspace; tempfile for tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Show the Windows 10 Agility hint only when the SM 6.6 check needs it
A run from the menu was `run::run` in the menu's own process, so a title
that crashed or exited took the window with it, and its last lines with
it. It is now a child `victory run <game> --execute` in the same console:
the menu says how it ended (the exit code, in hex for an NTSTATUS such as
0xC0000005) and waits for Enter. Ctrl+C and Ctrl+Break stop the run, not
the menu.

Also: hints wrap to the console's width, under the line they explain
(they ran back to the left edge); "Checking this PC..." shows while the
GPU device is made; the window is titled VIctory; opening the data folder
says which folder it opened.

Tried on Windows 10 19045 with a file that isn't a game: the child stops
with "malformed image", the menu shows exit code 1 and carries on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Check this PC" now starts its GPU lines with the default adapter's name
and user-mode driver version from DXGI, which it reads also where no
shader model 6.6 device can be made (the case "can't run" reports are
about). After the check, C then Enter puts it on the clipboard as plain
text for a GitHub report: no colour, no wrapping, the user's profile
folder written as %USERPROFILE%, through the Win32 clipboard as Unicode
text with CRLF line ends.

Tried on Windows 10 19045 with a GTX 1060: the line reads "GPU: NVIDIA
GeForce GTX 1060 6GB (driver 32.0.15.8266)", and the copied text starts
with "VIctory 0.1.0", keeps the check marks and holds no profile path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
PowerShell (Windows Terminal's default) pastes a dragged path as
`& 'D:\Games\Tom''s Game\title.exe'`, an apostrophe doubled inside single
quotes. The menu took the quotes off and kept `''`, so such a game was "No
file there". A double-quoted path (cmd) keeps its apostrophe as it is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three entries after the launcher in #1330 (sahajiscoding), written for
this menu:

- S sets [paths].game_dir in the config file the tools read
  (VICTORY_CONFIG, else victory.toml beside a double-clicked victory.exe).
  A dropped .exe stands for its folder. The active game_dir line is
  replaced, or one is added under [paths], or [paths] is appended. Every
  other line and comment stays. A folder inside the repository is
  refused with the asset-policy message, and the menu says when
  VICTORY_GAME_DIR overrides the file.
- K shows the keyboard's stand-in pad as gameinput.rs maps it and the
  README lists it.
- M switches the console model a run uses (victory run --console),
  remembered in the data folder.

Tests: the config edit on an empty file, on the example file (comments
kept, one game_dir), with and without [paths], with an apostrophe (a
basic string) and with CRLF, each read back with toml; the model
switch and its memory; the keys table; the run command's --console.
Tried in the built victory.exe with a scratch VICTORY_CONFIG: S from a
dragged .exe, M, K, and a repository folder refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:15:02 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 16:30 UTC · original

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).

**@⁠Zipettte** on GitHub · 2026-11-24 16:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/959#issuecomment-7137776886) 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)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:29 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 00:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/959#issuecomment-7148568932) <!-- 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)_
Author
Owner

@⁠denkencar-sketch on GitHub · 2026-11-25 07:33 UTC · original

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.

**@⁠denkencar-sketch** on GitHub · 2026-11-25 07:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/959#issuecomment-7155991532) 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 has changes conflicting with the target branch.
  • Cargo.lock
  • apps/victory/src/main.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/959/head:github-bot/gh-959'
git switch 'github-bot/gh-959'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-959'
git switch 'github-bot/gh-959'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-959'
git switch 'github-bot/gh-959'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-959'
git switch 'main'
git merge --squash 'github-bot/gh-959'
git switch 'main'
git merge --ff-only 'github-bot/gh-959'
git switch 'main'
git merge 'github-bot/gh-959'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!959
No description provided.