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

Negative Dependencies #3007

Open Trenly opened 1 year ago

Trenly commented 1 year ago

Description of the new feature / enhancement

Sometimes packages require things to not be installed / enabled. The current dependencies flow only accounts for enabling / installing, but doesn't have a way to cleanly terminate the install if windows features need to be disabled or other packages need to be uninstalled.

Currently, installers will just terminate with their error code, which could leave users wondering what the true issue is.

Proposed technical implementation details

No response

stephengillie commented 1 year ago

Is there an example of a package that prevents another package from being installed?

Trenly commented 1 year ago

Is there an example of a package that prevents another package from being installed?

I know that WindowsFeatures does, with some apps like BlueStacks requiring Hyper-V to be disabled (or at least they used to, not sure if it still does).

For packages, one clear example is Corsair.iCUE.3 which requires Corsair.iCUE.4 to not be installed. This is because although they are the "same" application, they are valid for different sets of corsair connected devices. iCUE 3 will throw error 1603, requiring users to go into the logs to find the true error

Trenly commented 1 year ago

@stephengillie - can you tag this with Dependencies too?

R-Adrian commented 1 year ago

Is there an example of a package that prevents another package from being installed?

here's one package that fails to install for me: https://github.com/microsoft/winget-pkgs/pull/97440

i think that's a bug in the Logitech GHUB installer but it's a very annoying one - it fails to install if newer versions of Microsoft Visual C++ 2015-2019 Redistributable (x64 / x86) are installed and it cannot force-downgrade them.

Masamune3210 commented 1 year ago

It is indeed a bug with G Hub's installer. It tries to install the redists without checking if the dependencies are already satisfied, and takes any error code other than success as failure, promptly aborting the installation shortly after. Unfortunately, the only one that can fix it is Logitech

Trenly commented 1 year ago

[Policy] Area-Manifest