Skip to content

Manifest fields for custom uninstall arguments and return codes #1885

@jedieaston

Description

@jedieaston

Description of the new feature / enhancement

We currently have a bunch of manifest fields for installing packages:

InstallerSwitches:
    Custom: /allthethings
    Silent:  /VERYSILENT
    SilentWithProgress: /somewhatsilent
InstallerSuccessCodes:
    - 12
    - 57
    - 99

But we don't have any for uninstalling packages. Many packages return funny error codes that still mean success after an uninstall, or require special arguments to make uninstall 100% silent. Currently, there isn't a way to tell winget to use these.

(I believe this will help with the Edge WebView2 issues, as it requires user interaction to uninstall and then it exits with a non-zero code, which halts the upgrade leaving the user with no WebView2).

Proposed technical implementation details

Some matching manifest keys that work similarly to the existing installer fields, per installer (I realize that it may be difficult to make a best guess at InstallerType if winget didn't install the package to begin with, but that will need to be implemented anyway at some point). Ideally, these switches should be ran on the local uninstall executable, presuming it still exists.

If a manifest isn't available for an app that a user wants to uninstall, then the current behavior should be preserved.

UninstallerSwitches:
    Custom: /uninstallallthethings
    Silent:  /VERYSILENT
    SilentWithProgress: /somewhatsilent
UninstallerSuccessCodes:
    - 12
    - 57
    - 99

Metadata

Metadata

Assignees

Labels

Area-ManifestThis may require a change to the manifestCommand-UninstallIssue related to WinGet UninstallIssue-FeatureThis is a feature request for the Windows Package Manager client.

Projects

Status

Assigned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions