feat: rvpm dist msi can add the install dir to PATH#864
Merged
Conversation
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.
Strix Security ReviewNo security issues found. Updated for Reviewed by Strix |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a new ChangesMSI add_to_path Feature
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
rvpm distpreviously 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 = truemakes 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)./usr/bin, already on PATH); the archives leave placement to the user.Testing
cargo test: 791 pass (fmt and clippy clean). New tests assert the WiX omits the PATH component by default and, withadd_to_path = true, includes thePathEntrycomponent, its ref, the exact<Environment>element, and the HKLM registry key path.Summary by CodeRabbit
New Features
Documentation
Bug Fixes