winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

uninstallAll option for upgrade/install behavior

Open Trenly opened this issue 3 years ago • 2 comments

Description of the new feature / enhancement

Side by side installs are potentially one of the most frustrating experiences for users, especially when they result in an upgrade loop unintentionally. Adding onto this, many users do not realize that some packages are installed side by side, or may even have side-by-side installs before they started using winget.

We currently have the option within manifests to specify that the previous version should be uninstalled before the new version is installed. While this helps prevent upgrade loops in some cases, it doesn't break the loop if one exists. It would be extremely useful to have a way to remove all previous versions before installing the new one.

Proposed technical implementation details

I see a few options:

1 - Add uninstallAll to the upgradeBehavior, and uninstall all previous versions when installing the package 2a - Change the default behavior of uninstallPrevious to uninstall all previous versions of the package 2b - Make the behavior of uninstallPrevious configurable through a user setting 3 - Add a --prune argument to install and upgrade that uninstalls all previous versions before installing the package

I'm sure there are pros and cons to each, and further discussion would be needed as to which may be best

Trenly avatar Oct 27 '22 12:10 Trenly

+1 for prune, it sounds like the best way to give the option to the user on if they want previous versions removed or not

Masamune3210 avatar Oct 27 '22 13:10 Masamune3210

Options for which I would vote for:

  • 2a - Change the default behavior of uninstallPrevious to uninstall all previous versions of the package
  • 3 - Add a --prune argument to install and upgrade that uninstalls all previous versions before installing the package

vedantmgoyal9 avatar Oct 27 '22 13:10 vedantmgoyal9