microsoft / microsoft/winget-cli
Upgrade --uninstall-previous fails when newer version's install technology is different from the current version installed.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Brief description of your issue
I was trying to investigate why LocalSend.LocalSend upgrade from 1.14.0 to 1.15.1 is silently ignored when running winget upgrade --all ( #1985 ) and found out it was due to different install technologies. I than tried winget install --id=LocalSend.LocalSend -e --uninstall-previous (Later I found that the 1.15.1 manifest even has a option called UpgradeBehavior: uninstallPrevious set). I assume that is the command that is specifially intended for this scenario. But to my supprise the command failed indicating that the previous version must be uninstalled first and than a new version can be installed. My expectation is that install --uninstall-previous should do precisly that.
Steps to reproduce
winget install --id=LocalSend.LocalSend -e --version 1.14.0
winget install --id=LocalSend.LocalSend -e --uninstall-previous --version 1.15.1
Expected behavior
winget install --uninstall-previous should uninstall the old version and install the new version regardless of the install technologies used.
Actual behavior
Install fails/is skipped
PS> & winget install --id=LocalSend.LocalSend -e --uninstall-previous
Es wurde bereits ein vorhandenes Paket gefunden. Es wird versucht, das installierte Paket zu aktualisieren...
Die Installationstechnologie der angegebenen neueren Version unterscheidet sich von der aktuell installierten Version. Deinstallieren Sie das Paket, und installieren Sie die neuere Version.
Environment
Windows-Paket-Manager v1.8.1911
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
Windows: Windows.Desktop v10.0.19045.4651
Systemarchitektur: X64
Paket: Microsoft.DesktopAppInstaller v1.23.1911.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior with the two winget install commands for LocalSend versions 1.14.0 and 1.15.1, then inspect how --uninstall-previous interacts with differing install technologies and the manifest's UpgradeBehavior: uninstallPrevious setting. Done means the older version is removed and the newer version is installed successfully across differing install technologies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100