Skip to content

feat: Windows installer + icon mode (#229, #230) - #232

Merged
matheuswhite merged 7 commits into
mainfrom
feat/229-230-installer-icon-mode
Jul 29, 2026
Merged

feat: Windows installer + icon mode (#229, #230)#232
matheuswhite merged 7 commits into
mainfrom
feat/229-230-installer-icon-mode

Conversation

@matheuswhite

Copy link
Copy Markdown
Owner

Summary

Adds a Windows installer (#229) and an "icon mode" (#230) so non-technical users can install and use scope without the terminal.

Icon mode (#230): launching serial/rtt without the positional arguments (e.g. from a Start-Menu shortcut) opens an interactive ratatui picker before the TUI/headless bridge starts — pick a serial port + baud (or an RTT target + channel). Gated on an interactive terminal, so piped/scripted runs keep the historical start-disconnected behaviour (also reachable via the picker's s = skip; q/Esc quits). New module src/selector.rs; wired through resolve_serial/resolve_rtt in main.rs.

Installer (#229): distribution moves to cargo-dist (dist-workspace.toml). A tag-triggered release.yml builds tarballs/zip, shell/powershell installers and a Windows .msi; crates.io publishing is preserved in a companion publish-crates.yml on the same tag.

Icons + shortcuts (#230): the MSI installs scope on the PATH and adds four Start-Menu shortcuts — scope Serial, scope Serial (headless), scope RTT, scope RTT (headless) — each with its own icon (via a hand-edited wix/main.wxs, allow-dirty = ["msi"]). Icons are generated by the standalone installer/gen-icons/ helper (kept out of the scope build) from the logo + Font Awesome glyphs; build.rs embeds scope.ico into scope.exe on Windows.

⚠️ Release-flow change: releases now trigger on a vX.Y.Z git tag (was: a push to main touching Cargo.toml). Maintainer flow: bump the version, push the tag. Documented in CONTRIBUTING/CLAUDE.md.

Related issue

Closes #229
Closes #230

Type of change

  • New feature
  • Documentation
  • Bug fix
  • Refactor / internal

How was this tested?

On macOS (Apple Silicon):

  • cargo fmt --all -- --check, cargo test --locked (237 unit tests), cargo build --locked --release — all pass.
  • cargo test --test tui_e2e -- --test-threads=1 — 23 pass (1 ignored). Note: this suite is flaky under the default parallel run; serial run is stable.
  • Icon mode driven end-to-end over a real USB serial port (test-tui skill): port list → baud → TUI connecting on the chosen port/baud; custom baud; skip → disconnected; quit → exit 0; RTT target/channel flow.
  • dist plan confirms the artifact set (incl. the .msi); wix/main.wxs is XML-validated.

Not validated locally (no Windows/WiX): the MSI build, the four shortcuts and the embedded .exe icon are only exercised on Windows CI / at release. Watch the installer\icons\... paths in main.wxs (assumed relative to the project root) and the winresource resource compile.

Checklist

  • cargo fmt --all -- --check passes
  • cargo test --locked passes
  • cargo build --locked --release passes
  • I added or updated tests where it made sense
  • I updated the documentation (README / CONTRIBUTING / CLAUDE.md)
  • I did not bump the version in Cargo.toml

matheuswhite and others added 7 commits July 27, 2026 11:32
When 'scope serial' / 'scope rtt' is launched without its positional
arguments (e.g. from a Windows Start-Menu shortcut), show an interactive
ratatui picker before starting: choose a serial port + baud rate (a list
from usb_ports), or an RTT target + channel. It runs on the main thread,
owns its own crossterm session, and always restores the terminal on exit.

resolve_serial/resolve_rtt gate it on both a missing argument and an
interactive terminal, so piped/scripted runs keep the historical
start-disconnected behaviour (also reachable via the picker's Skip).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…#230)

Switch distribution to cargo-dist (dist-workspace.toml): a tag-triggered
release.yml builds tarballs/zip, shell/powershell installers and a Windows
.msi; libudev-dev is installed on the Linux runner via apt deps. Publishing
to crates.io is kept in a companion publish-crates.yml on the same tag
(dist does not publish to crates.io), and version-guard's comment is updated
to the new tag-based flow.

The MSI's main.wxs is hand-edited (allow-dirty = ["msi"]) to add four
per-command Start-Menu shortcuts (serial, --headless serial, rtt,
--headless rtt), each with its own icon. Icons live in installer/icons/ and
are produced by the standalone installer/gen-icons/ helper (kept out of the
scope build) from the logo + Font Awesome glyphs; build.rs embeds scope.ico
into scope.exe on Windows via winresource.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
README gains install instructions for the Windows installer and the
shell/powershell scripts, plus an 'Icon mode' section. CONTRIBUTING and
CLAUDE.md describe the new maintainer release flow (bump version, push a
vX.Y.Z tag -> cargo-dist + crates.io) and the icon-mode/selector internals.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Releasing is now maintainer-only, enforced in depth so no PR or non-owner
collaborator can cut one:

- publish-crates.yml is guarded with 'if: github.actor ==
  github.repository_owner', deploys through the reviewer-gated 'crates'
  environment, and refuses to publish when the tag != Cargo.toml version.
- tests/release_security.rs parses the workflows and fails CI if the security
  invariants regress (no pull_request_target; publish-crates fires on version
  tags only, owner-guarded, env-gated; release.yml never publishes on a PR;
  version-guard runs on PRs). Verified the tests detect regressions.
- .github/CODEOWNERS makes the release-critical paths owner-owned; paired with
  the main ruleset's code-owner-review requirement.

Repo-settings pieces applied out-of-tree: a tag-protection ruleset (tag
creation is admin-only) and the 'crates' environment's required reviewer.
Documented in CONTRIBUTING.md ('Release security') and CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
`dist-workspace.toml` gains `pr-run-mode = "upload"`, so every pull request
now builds the same archives and installers a version tag would and attaches
them to the Actions run. This is how the Windows `.msi` (and its Start-Menu
shortcuts/icons, #230) gets tested on a real Windows machine before a release
is cut — until now the only way to produce one was to push a tag.

Publishing is unaffected: `release.yml` still gates every publish step on
`publishing: !github.event.pull_request`, and `publish-crates.yml` triggers on
tags only, so a PR uploads artifacts without creating a release or touching
crates.io. `tests/release_security.rs` stays green.

`release.yml` is regenerated with `dist generate` (dist 0.32.0, the pinned
version); the only change it produces is the rust-cache step dist adds in
upload mode.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The `scope serial` Start-Menu icon carried Font Awesome's `plug` glyph, which
reads as a power plug rather than a data link. Swap it for `ethernet` (same
Font Awesome Free 6.7.2 set, CC BY 4.0), which reads as a connector at a
glance and pairs better with the RTT variant's microchip.

`plug.svg` is dropped since nothing references it any more. Only
`scope-serial.ico` changes when the generator re-runs — the other four icons
come out byte-identical.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`pr-run-mode = "upload"` was a temporary measure to get a Windows `.msi` out of
the PR's CI run so the installer, the Start-Menu shortcuts and their icons
could be tested on a real Windows machine (#229, #230). That test passed, so
drop it again — otherwise every pull request pays for a full three-platform
release build.

`dist-workspace.toml` and the dist-generated `release.yml` are back to their
pre-test state, byte for byte. What stays is the write-up of the procedure in
CONTRIBUTING.md ("Testing the installers before a release"), so the next person
who needs an `.msi` can flip the flag on and off deliberately.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@matheuswhite
matheuswhite merged commit 897da26 into main Jul 29, 2026
13 checks passed
@matheuswhite
matheuswhite deleted the feat/229-230-installer-icon-mode branch July 29, 2026 02:31
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.

Windows icon mode Windows installer

1 participant