CLI reference
Implemented build, inspect, install, verify and uninstall commands in the BSIS prototype.
Experimental CLI
These commands exist in the current private Rust prototype. They are not a stable public API or published binary.
BSIS uses one Rust executable as both a developer build tool (before packaging) and the console runtime of a packaged setup executable.
Command summary
| Command | Purpose | Where to run |
|---|---|---|
build | Embed files into a standalone Windows executable | Unbundled builder |
plan | Validate config and inventory package files without creating Setup.exe | Unbundled builder |
inspect | Validate and list the packaged files | Builder or packaged setup |
gui | Launch the experimental offline install or uninstall wizard | Packaged Setup.exe or installed Uninstall.exe on Windows with WebView2 |
install | Install to a new destination | Packaged setup |
uninstall | Remove only verified, tracked installed files | Installed Uninstall.exe or packaged setup |
verify | Audit receipt and file hashes without modifying anything | Setup.exe, installed Uninstall.exe, or builder |
Plan a build before packaging
cargo run -p bsis --locked -- plan --config examples/hello/bsis.json
cargo run -p bsis --locked -- plan --config examples/hello/bsis.json --json
The planner validates schema version 1, scans relative source mappings, checks Windows destination names and collisions, computes per-file SHA-256 checksums, and reports the uncompressed file count/size. It does not write Setup.exe.
The required --config <path> selects the JSON source configuration, while optional --json returns a structured inventory for CI. A failed preflight exits nonzero, for example when two paths would collide on Windows.
Files can change after preflight. The separate build operation always validates and hashes sources again. See Package preflight.
Build
cargo run -p bsis -- build --config examples/hello/bsis.json --runtime target/release/bsis.exe --output BSIS-Hello-Setup.exe
| Flag | Required | Meaning |
|---|---|---|
--config <path> | Yes | JSON build configuration (schema version 1) |
--runtime <path> | Yes | Unbundled Windows PE executable to package |
--output <path> | Yes | Path for the generated setup executable |
--compression-level <1..19> | No | Zstandard compression level (default 3); higher levels trade packaging time for potentially smaller files |
You can select a supported compression level without modifying the JSON config:
cargo run -p bsis --locked -- build --config examples/hello/bsis.json --runtime target/release/bsis.exe --output BSIS-Hello-Setup.exe --compression-level 9
Invalid levels (for example 0 or 20) fail before the setup executable is created. build without this flag continues to use Zstandard level 3. The build summary now reports the selected level. See Packaging for behavior, tradeoffs and verification.
See Configuration for the supported JSON fields. The builder appends the Zstandard-compressed payload to the provided runtime. The runtime now contains a fixed opt-in WebView2 GUI; it does not yet compile developer-supplied HTML/Svelte/React screens.
Inspect
.\BSIS-Hello-Setup.exe inspect
Inspect validates the embedded bundle and prints product information, the file count, compressed size and file paths. When run on an unbundled builder, you can inspect a different setup executable:
.\target\release\bsis.exe inspect --bundle .\BSIS-Hello-Setup.exe
| Flag | Required | Meaning |
|---|---|---|
--bundle <path> | No | Read the specified bundle instead of the current executable |
--deep | No | Decompress and verify every declared payload file without extracting |
--json | No | With --deep, emit a machine-readable verification report |
Deep package inspection
Use deep mode to check package contents before installation or in CI:
.\BSIS-Hello-Setup.exe inspect --deep
.\BSIS-Hello-Setup.exe inspect --deep --json
Normal inspect validates the compressed payload digest and manifest header. Deep inspection additionally decompresses and SHA-256 checks every embedded file, rejects truncated content and undeclared trailing bytes, and does not install or write files.
JSON includes product, verified_files, verified_bytes and compressed_bytes. A mismatch returns a nonzero exit status. These checks do not authenticate the publisher.
Install
.\BSIS-Hello-Setup.exe install --target "$env:LOCALAPPDATA\BSIS-Hello-Test" --yes
| Flag | Required | Meaning |
|---|---|---|
--target <path> | No | Installation destination; must be new or an existing empty directory |
--yes | No | Skip the install confirmation prompt |
With no target, BSIS proposes a per-user destination under %LOCALAPPDATA%\Programs\<product.id>. Running the packaged executable without arguments starts an interactive console prompt to choose the destination and confirm.
The --yes option skips confirmation. It does not mean that updates, unattended GUI workflows or privileged installation are implemented.
Graphical installer preview
.\BSIS-Hello-Setup.exe gui
.\BSIS-Hello-Setup.exe gui --dev
| Option | Result |
|---|---|
gui | Normal installer without right-click browser menus, Inspect Element or browser shortcuts |
gui --dev | Enable browser context menu, Inspect Element and browser shortcuts for UI debugging |
This command launches a bundled offline HTML/CSS wizard. Enter a new or empty folder and select Install now. The progress bar uses real native streamed-byte events, distinguishes in-flight bytes from SHA-256-verified file counts, and stays below 100% until after the commit. The finalization phase is distinct from completed installation. The GUI calls the same validated Rust installation function as console mode and displays the result. No-argument Setup.exe still starts console mode.
This command is not available on Linux and does not bundle the WebView2 Runtime. The installed Uninstall.exe does not contain a package payload: Uninstall.exe gui opens its own receipt-verified removal wizard, not the installer wizard. See Installer UI for requirements, supported interactions and missing features.
Verify installed files
Inspect the receipt and all tracked files (including managed Uninstall.exe) without deleting or repairing anything:
.\BSIS-Hello-Setup.exe verify --target "$env:LOCALAPPDATA\Programs\bsis.hello"
.\BSIS-Hello-Setup.exe verify --target "$env:LOCALAPPDATA\Programs\bsis.hello" --json
The required --target is the absolute installation folder. Optional --json prints structured results with product, location, expected_files, verified_files and an array of issues. Missing, modified, unreadable and unsafe tracked files are reported together. Verification exits nonzero if drift is found, or if the receipt is missing or invalid.
See Verify installations for details and limitations.
Uninstall
.\BSIS-Hello-Setup.exe uninstall --target "$env:LOCALAPPDATA\BSIS-Hello-Test" --yes
| Flag | Required | Meaning |
|---|---|---|
--target <path> | Yes | Absolute path of an installation with a BSIS receipt |
--yes | No | Skip the uninstall confirmation prompt |
BSIS checks the receipt and hashes of tracked files (including its own managed Uninstall.exe) before deleting anything. Modified tracked files block uninstall; unrelated files are retained. New installs include a native Uninstall.exe, but Windows Apps & Features registration is still missing.
PowerShell requires the call operator & before quoted executable paths. For example, if Setup.exe is saved on the Desktop:
& "$env:USERPROFILE\Desktop\BSIS-Hello-Setup.exe" uninstall --target "$env:USERPROFILE\Desktop\Botnitew\test" --yes
If you already opened PowerShell in the folder containing Setup.exe, prefix the executable with .\, as in the example below:
.\BSIS-Hello-Setup.exe uninstall --target "$env:USERPROFILE\Desktop\Botnitew\test" --yes
The setup executable must exist at the given path. Windows does not automatically preserve EXEs opened from a ZIP archive. Extract the ZIP to a permanent folder before installation; otherwise, the printed temporary path may no longer exist later.
Installed uninstaller (new installs)
& "$env:LOCALAPPDATA\BSIS-Hello-Test\Uninstall.exe" uninstall --target "$env:LOCALAPPDATA\BSIS-Hello-Test" --yes
To show the experimental graphical removal confirmation instead, run .\Uninstall.exe gui from its installation folder. This requires WebView2 on Windows. The GUI never accepts an arbitrary removal directory, uses the same native receipt verification and keeps untracked files. You may also double-click Uninstall.exe in the application folder for a console confirmation prompt. This native executable is copied from the Rust runtime during installation; it does not require the original Setup.exe or its compressed payload. On Windows, it launches a best-effort post-exit cleanup process to remove itself and the now-empty installation folder. Unrelated files are left untouched.
Older installs with no Uninstall.exe can still be removed using the original Setup.exe. Read the dedicated Uninstaller guide for safety guarantees and limitations.
Exit and error behavior
Successful commands exit normally. Runtime errors print a BSIS error: message to standard error and exit with status 1. Command-line argument validation is handled by Clap.
If your scenario fails, consult Troubleshooting. Do not use this prototype for production deployments.