winget-cli
winget-cli copied to clipboard
Introduce a key for safely self upgradable packages
Description of the new feature/enhancement
This feature request closely related to: https://github.com/microsoft/winget-cli/issues/120 https://github.com/microsoft/winget-cli/issues/223 https://github.com/microsoft/winget-cli/issues/405
There are programs which can be safely self upgrade itself, like Node.js.
Until there will be a solution for upgradable packages, this will make it possible to upgrading some of the packages, which installers already taken care of this problem.
Proposed technical implementation details (optional)
My suggestion is to introduce a key, which is turned off globally by default. Those programs whose tested that they can be safely upgraded, their YAML should have a key like:
Upgradable: true
I also suggesting that if the package is a single executible (like Terraform), than this should be also tested and turned on.
@DJviolin We have been looking at this scenario. Your suggestion is very similar to what we are thinking in terms of a key in the manifest providing a hint to the client about the package that has been installed.
We added the following key to the schema to help with packages that upgrade themselves.
When WinGet sees this present in the manifest, the default behavior for winget upgrade --all is to skip this package. The argument "--include-explicit" would allow WinGet to upgrade packages known to upgrade themselves.
https://github.com/microsoft/winget-cli/blob/83cd0dcaddd31cc64570422b081f7743a79dc10d/schemas/JSON/manifests/v1.5.0/manifest.installer.1.5.0.json#L433-L436