Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More granular control for winget import #5238

Open
AdreKiseque opened this issue Feb 22, 2025 · 3 comments
Open

More granular control for winget import #5238

AdreKiseque opened this issue Feb 22, 2025 · 3 comments
Labels
Command-Import Issue related to WinGet Import Issue-Feature This is a feature request for the Windows Package Manager client.

Comments

@AdreKiseque
Copy link

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 import respect and use the preferences set in settings.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 --custom and --override parameters 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.

@AdreKiseque AdreKiseque added the Issue-Feature This is a feature request for the Windows Package Manager client. label Feb 22, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Feb 22, 2025
@Trenly
Copy link
Contributor

Trenly commented Feb 22, 2025

[Policy] Command Import

@microsoft-github-policy-service microsoft-github-policy-service bot added Command-Import Issue related to WinGet Import and removed Needs-Triage Issue need to be triaged labels Feb 22, 2025
@denelon
Copy link
Contributor

denelon commented Feb 24, 2025

There have been several other issues related to improvements to the packages.json schema. Most of these have the Command-Import label.

It's more a matter of priority than technical difficulty. None of these issues other than:

@AdreKiseque
Copy link
Author

Ah, I'd completely missed there was a tag for it. I'd just tried searching "import" in the issues and didn't find anything. Thanks for showing me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-Import Issue related to WinGet Import Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
Development

No branches or pull requests

3 participants