microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.39k stars 1.46k forks source link

Ability to specify a default installer type in the manifest #3866

Open mdanish-kh opened 1 year ago

mdanish-kh commented 1 year ago

Description of the new feature / enhancement

If two or more installers are equally suitable in terms of architecture, scope and other parameters etc, there should be a way to specify a default installer type for fresh install scenarios in the manifest. I'm aware of --installer-type but the average user would want to have the best experience with default args

Example

As reported in https://github.com/microsoft/winget-pkgs/issues/125309, the manifest contains both portable and nullsoft installers that are equal in terms of arch, scope etc. In fresh install flow, winget selects the installer that is defined first in the manifest. Re-ordering the manifest would make it choose the other installer.

Steps to reproduce to verify that behavior would be:

  1. Locally clone winget-pkgs and install Streetwriters.Notesnook winget install -m manifests/s/Streetwriters/Notesnook/2.4.0

    Notice it selects the portable installer (defined earlier in the manifest)

  2. Re-order the installer nodes

  3. Install the manifest locally again. Notice it will select the nullsoft installer this time.

Proposed technical implementation details

No response

Trenly commented 1 year ago

I'm wondering if there shouldn't be some sort of default preference built into the client. I know it wouldn't be everyone's first choice, but I would imagine that 90% of scenarios would be covered by an order of