microsoft / microsoft/winget-cli
More granular control for winget import
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Description of the new feature / enhancement
WinGet's import command, while convenient in principle, is, to be blunt, extremely limited. There's no support for custom install arguments and, according to the documentation, it doesn't even respect set preferences. This all effectively makes the command a complete non-starter for anyone who needs more than the default install behaviour (which, if you're going through the trouble of automation, you probably do).
I have to assume there's some technical difficulty in implementing this, since it feels like fairly obvious functionality, but I wasn't able to find any issues bringing it up. In any case, this is my feature request to:
- Make
winget importrespect and use the preferences set insettings.json(with an option to ignore them) - Allow special preferences to be specified for a particular import manifest in the file and/or when running the command (with override options)
- Allow custom arguments to be specified on a per-package basis inside the manifest file—particularly, the use of the
--customand--overrideparameters to specify particular arguments for the package installer
Proposed technical implementation details
Arguments such as --no-preferences, --use-set-preferences, --use-file-preferences, --custom-preferences [custom preferences], etc. could be used with winget import to specify behaviour in regards to preferences declared in WinGet's settings, the manifest file and in the command itself. The user could choose to use default behaviour and disregard any preferences set anywhere (current behaviour), override custom preferences set in the json file and use those set in WinGet's settings, or to provide their own preferences to override the others. By default, manifests providing custom preferences would take precedance over preferences in settings, but a preference in settings (ironically) could be used to change this.
A way to allow "stacking" of preferences, for lack of a better term—perhaps WinGet's settings specify a preferred scope while the manifest specifies a prefered architecture; since there's no conflict between these two settings they could both be used. A flag such such as --(dis)allow-stacking could be used to manage this, and it could also be an option within the manifest.
Preference hiearchy of command options > manifest specifications > WinGet settings would likely be ideal.
Custom preferences in the manifest could be specified in the same format as in WinGet's settings.
Keys such as customArguments or overrideArguments could be used for packages within the manifest as analogues to the --custom and --override options in winget install.
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 reading the winget import command and the settings.json and manifest preference handling described in the issue. Define the precedence and stacking rules for command, manifest, and settings preferences, including per-package custom and override arguments; done requires an agreed, testable design and corresponding coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100