Skip to content

Add Windows CLI feature parity with Unix installer#3617

Open
dimension-zero wants to merge 1 commit into
ventoy:masterfrom
dimension-zero:windows-cli-feature-parity
Open

Add Windows CLI feature parity with Unix installer#3617
dimension-zero wants to merge 1 commit into
ventoy:masterfrom
dimension-zero:windows-cli-feature-parity

Conversation

@dimension-zero

Copy link
Copy Markdown

Summary

Brings the Windows `Ventoy2Disk.exe VTOYCLI` mode up to feature parity with the existing Unix CLI installer (`Ventoy2Disk.sh`).

Before this change, `VTOYCLI` was only used silently by the Windows GUI as a web-server backend and lacked the interactive/informational flags that the Unix CLI already supports.

Flags added

Flag Behaviour
`/HELP`, `/?` Print usage to console; exit 0
`/V` Print local Ventoy version from `ventoy\version`; exit 0
`/L` List Ventoy version, partition style, secure boot, filesystem, disk size, bus type (read-only — no changes made)
`/SI` Safe install — refuses if Ventoy already present; double-prompt confirmation before writing (suppressed with `/Y`)
`/SB` Explicitly enable secure boot support (mirrors Unix `-s`)
`/Y` Auto-confirm prompts for scripted / silent use
`/Label:NAME` Set volume label for partition 1 (default: `Ventoy`); propagated through all four `DiskService` backends

Plumbing notes

  • Console I/O: `AttachConsole(ATTACH_PARENT_PROCESS)` + `_open_osfhandle` so `printf` works from both interactive `cmd.exe` and PowerShell pipe capture (`> file`, `$(...)`).
  • `WinDialog`: `/HELP`, `/?`, `/V`, `/L` skip the boot-file presence check so they work from any directory; other CLI write operations log the error instead of showing a `MessageBox`.
  • New user-facing doc `DOC/Windows_CLI.txt` (105 lines) with examples and a Unix→Windows flag mapping table.

Stats

  • 9 files changed: +354 / −22
  • Behaviour preserved when the existing single `VTOYCLI` argument is used (GUI/Plugson web backend unchanged)

Test plan

  • `Ventoy2Disk.exe VTOYCLI /HELP` prints usage in cmd.exe
  • `Ventoy2Disk.exe VTOYCLI /V` prints version
  • `Ventoy2Disk.exe VTOYCLI /L` lists disk info without writing
  • `Ventoy2Disk.exe VTOYCLI /I /Drive:X /Y` performs install on drive X without prompts
  • `Ventoy2Disk.exe VTOYCLI /SI /Drive:X` refuses if Ventoy already present
  • `Ventoy2Disk.exe VTOYCLI /U /Drive:X /Label:MyUSB` updates and sets label
  • GUI mode (no VTOYCLI argument) behaves unchanged

@dimension-zero dimension-zero force-pushed the windows-cli-feature-parity branch from 42e0dc0 to 054855f Compare May 20, 2026 15:21
…, /Label

The Windows VTOYCLI mode was built as a silent GUI web-server backend and
lacked the interactive and informational features of the Unix CLI. This commit
adds full feature parity:

- /HELP and /?: print usage to the console and exit 0
- /V: print the local Ventoy version (from ventoy\version) and exit 0
- /L: list Ventoy version, partition style, secure boot, filesystem, disk
      size and bus type for the selected drive (read-only, no changes made)
- /SI: safe install — refuses if Ventoy is already present; prompts for
       confirmation twice before writing (suppressed with /Y)
- /SB: explicitly enable secure boot support (mirrors Unix -s flag)
- /Y: auto-confirm prompts for scripted/silent use
- /Label:NAME: set the volume label for partition 1 (default: Ventoy);
               propagated through all four DiskService backends

Console output: AttachConsole + _open_osfhandle so printf works from both
interactive cmd.exe sessions and PowerShell pipe capture (> file, $(...)).

WinDialog: /HELP, /?, /V and /L skip the boot-file presence check so they
work from any directory; other CLI write operations log the error instead
of showing a MessageBox.

DOC/Windows_CLI.txt: new user-facing documentation with examples and a
Unix-to-Windows flag mapping table.
@dimension-zero dimension-zero force-pushed the windows-cli-feature-parity branch from 054855f to 9444e82 Compare May 20, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant