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.21k stars 1.45k forks source link

Support alternative dependency #2103

Open stevapple opened 2 years ago

stevapple commented 2 years ago

Description of the new feature / enhancement

Some of the packages are known to be conflicted (eg. Microsoft.VC++2015-2022Redist-x64 and Microsoft.VC++2015-2019Redist-x64), but we can only specify one of them in the manifest, and users with another installed cannot successfully upgrade or install our package.

Proposed technical implementation details

We have several means of resolving this:

jedieaston commented 2 years ago

Do you think that the proposal in https://github.com/microsoft/winget-cli/issues/1789 would resolve this problem? Several packages that each would satisfy the same dependency.

stevapple commented 2 years ago

@jedieaston I think that’s almost the third option I proposed — but I believe there should be a primary (in other word, recommended) one, which winget will pick up when neither of the alternatives matches.

denelon commented 2 years ago

We've been discussing the best way to handle determining which of a collection of dependencies to install if none are present. One of our goals is to support unattended "import" scenarios. This scenario is one of the more complex ones due to dependencies like language runtimes that may have different licensing concerns.

stevapple commented 2 years ago

My preferred manifest layout would be:

# ...
Dependencies:
  PackageDependencies:
  - PackageIdentifier: Microsoft.VC++2013Redist-x64
    MinimumVersion: 12.0.30501.0
  - PackageIdentifier: Microsoft.VC++2013Redist-x86
    MinimumVersion: 12.0.30501.0
  - PackageIdentifier: Microsoft.VisualStudio.2019.Community
    MinimumVersion: 16.11.0
    Alternatives:
    - PackageIdentifier: Microsoft.VisualStudio.2019.Professional
      MinimumVersion: 16.11.0
    - PackageIdentifier: Microsoft.VisualStudio.2019.Enterprise
      MinimumVersion: 16.11.0
    - PackageIdentifier: Microsoft.VisualStudio.2022.Community
    - PackageIdentifier: Microsoft.VisualStudio.2022.Professional
    - PackageIdentifier: Microsoft.VisualStudio.2022.Enterprise

The easiest way is to let the application vendor decide the recommended option, which some of them are already doing in official documents or installation guides. In my scenario this just works. However, I do understand that there could be more complicated needs (license for example).

Trenly commented 1 year ago

[Policy] Dependencies