Skip to content

feat: rvpm dist msi can add the install dir to PATH#864

Merged
martian56 merged 1 commit into
mainfrom
feat/msi-add-to-path
Jul 4, 2026
Merged

feat: rvpm dist msi can add the install dir to PATH#864
martian56 merged 1 commit into
mainfrom
feat/msi-add-to-path

Conversation

@martian56

@martian56 martian56 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

What changed

rvpm dist previously left PATH alone for every format, so an msi-installed CLI tool was not callable from a terminal (it lands in a Program Files app folder that is not on PATH). Add an opt-in.

  • [dist.windows].add_to_path = true makes the generated WiX include a component whose <Environment> element appends the install directory ([APPDIR]) to the system PATH (Part="last", System="yes"); the uninstaller removes it. A <RegistryValue> under HKLM is the component key path, keyed by the package name (an Environment element cannot be a key path).
  • Off by default, so a packaged GUI app still leaves PATH untouched. The deb and rpm formats are unaffected (they install to /usr/bin, already on PATH); the archives leave placement to the user.
  • Spec updated, including the out-of-scope note.

Testing

  • cargo test: 791 pass (fmt and clippy clean). New tests assert the WiX omits the PATH component by default and, with add_to_path = true, includes the PathEntry component, its ref, the exact <Environment> element, and the HKLM registry key path.

Summary by CodeRabbit

  • New Features

    • Added an optional Windows installer setting to append the install directory to the system PATH during MSI installation.
    • The installer now removes the PATH entry when the app is uninstalled.
  • Documentation

    • Updated the packaging spec to describe the new Windows PATH option and clarify which package formats can modify PATH.
  • Bug Fixes

    • Improved installer behavior so PATH changes happen only when explicitly enabled.

Add a [dist.windows].add_to_path option. When set, the generated WiX
adds a component with an Environment element that appends the install
directory to the system PATH (Part=last, System=yes), so a command-line
tool installed by the msi is callable from a terminal, and the
uninstaller removes the entry. A registry value under HKLM is the
component key path, since an Environment element cannot be one. Off by
default, so a GUI app's installer still leaves PATH alone. The other
formats are unaffected: deb and rpm install to /usr/bin.
@martian56 martian56 self-assigned this Jul 4, 2026
@strix-security

strix-security Bot commented Jul 4, 2026

Copy link
Copy Markdown

Strix Security Review

No security issues found.

Updated for 0a164b3.


Reviewed by Strix
Re-run review · Configure security review settings

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d0b94e5-03c5-4bc5-8d3b-d7ecfdd42860

📥 Commits

Reviewing files that changed from the base of the PR and between 2106804 and 0a164b3.

📒 Files selected for processing (3)
  • docs/v2/specs/rvpm-dist.md
  • src/manifest/mod.rs
  • src/ops/dist.rs

📝 Walkthrough

Walkthrough

Adds a new add_to_path boolean option under [dist.windows] in the manifest schema, validates and defaults it to false, and uses it in wix_source to conditionally emit WiX XML that registers the install directory in the system PATH. Documentation and tests are updated accordingly.

Changes

MSI add_to_path Feature

Layer / File(s) Summary
Manifest schema and validation
src/manifest/mod.rs
Adds add_to_path: bool to DistWindows and Option<bool> to RawDistWindows, defaulting to false when validating dist config.
WiX generation and tests
src/ops/dist.rs
wix_source conditionally emits a PathEntry component, ComponentRef, HKLM registry value, and Environment element for PATH updates; tests cover both default (omitted) and enabled behavior.
Spec documentation
docs/v2/specs/rvpm-dist.md
Documents the add_to_path manifest option and clarifies that only the MSI (when enabled) modifies PATH, unlike deb/rpm/tar/zip.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Manifest as Manifest (dist.windows)
  participant WixSource as wix_source
  participant MSI as Generated MSI

  Manifest->>WixSource: add_to_path = true
  WixSource->>WixSource: build PathEntry component + Environment element
  WixSource->>MSI: emit WiX XML with PathEntry, ComponentRef, Environment
  MSI->>MSI: install sets PATH via HKLM registry entry
Loading

Possibly related PRs

  • martian56/raven#858: Both PRs touch the rvpm dist Windows/MSI packaging pipeline, extending the manifest's Windows dist options and src/ops/dist.rs WiX generation.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change and testing, but it does not follow the required template sections. Add the missing Summary, Changes, Test plan checklist, Related issues, and Notes for reviewers sections in the repository template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding an opt-in PATH update for MSI installs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/msi-add-to-path

Comment @coderabbitai help to get the list of available commands.

@martian56 martian56 merged commit 1272c94 into main Jul 4, 2026
7 checks passed
@martian56 martian56 deleted the feat/msi-add-to-path branch July 4, 2026 12: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