microsoft / microsoft/winget-cli
Allow replacing RelativeFilePath prefix for portable packages
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Relevant area(s)
WinGet CLI
Description of the new feature / enhancement
I wanted to have a portable app installed to a single constant location to avoid some issues with variable paths, e.g., with firewall rules breaking due to path changes, requiring user intervention.
But if a manifest has defined RelativeFilePath like so, I can't do that
NestedInstallerFiles:
- RelativeFilePath: PatchCleanerPortable_1_4_2_0\PatchCleaner\PatchCleaner.exe
I'd like to be able to add a way to replace the variable prefix
Proposed technical implementation details
Add a flag that accepts a regex replacement rule to be applied to the RelativeFilePath --replace-relative-path 'regex_rule' so users could replace the variable prefix, e.g.,
--replace-relative-path '^PatchCleanerPortable.*\\' would result in the installation to a fixed PatchCleaner folder, removing the PatchCleanerPortable_1_4_2_0\ (would be nice if winget could cleanup \ itself if the user forgets)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing WinGet CLI option handling and the installation flow that consumes manifest RelativeFilePath values. Determine how a replacement rule should interact with nested installer paths, separators, and fixed destinations. Done means the proposed option consistently produces the requested portable installation layout and has coverage for the example path transformation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100