microsoft / microsoft/winget-cli

uninstallAll option for upgrade/install behavior

Open
#2,645 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Feature Side-by-Side
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing upgradeBehavior and uninstallPrevious behavior, then compare the proposed manifest, setting, and --prune approaches for install and upgrade. The issue needs a design decision before implementation can begin; done would mean the selected behavior is implemented for removing prior versions before installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.