Install --uninstall-previous fails with different install technology
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
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Closed similar issues:
- Cant install update because of different install technology (#4139), similarity score: 0.76
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Can you share verbose logs with the failure scenario by adding "--verbose-logs --logs" to the command?
Do you get the same behavior with:
winget upgrade LocalSend.LocalSend
Yes the result from upgrade und install+uninstall-previous are pretty much the same.
PS> & winget upgrade --id=LocalSend.LocalSend -e --verbose-logs --logs
A newer version was found, but the install technology is different from the current version installed. Please uninstall the package and install the newer version.
PS> & winget install --id=LocalSend.LocalSend -e --uninstall-previous --verbose-logs --logs
Found an existing package already installed. Trying to upgrade the installed package...
A newer version was found, but the install technology is different from the current version installed. Please uninstall the package and install the newer version.
PS> & winget --info
Windows Package Manager v1.8.1911
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.19045.4651
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0
I attached the two log file from the two commands.
WinGet-2024-07-25-17-27-14.419.log WinGet-2024-07-25-17-27-50.688.log
/EDIT: As further info & winget uninstall LocalSend.LocalSend; & winget install LocalSend.LocalSend works just as expected. So it's not that uninstall can't remove the software anymore.
OK, I think I might have an idea about what "might" be happening. I'll chat with our engineering folks to see if that's the issue.
What happens with:
winget upgrade --id=LocalSend.LocalSend -e --uninstall-previous --version 1.15.1
winget upgrade --id=LocalSend.LocalSend -e --uninstall-previous --version 1.15.1 --verbose-logs --logs
The install technology of the newer version specified is different from the current version installed. Please uninstall the package and install the newer version.
Thanks for sharing the logs.
I just encountered this bug again in winget v1.11.430 when trying to upgrade Oracle.VirtualBox from 7.1.12 to 7.2.0. The upgrade is still terminated due to incompatible installer types even though uninstall-previous is requested.
PS> & winget --info
Windows Package Manager v1.11.430
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.19045.6216
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.26.430.0
[...]
Admin Setting State
--------------------------------------------------
LocalManifestFiles Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride Disabled
LocalArchiveMalwareScanOverride Disabled
ProxyCommandLineOptions Disabled
DefaultProxy Disabled
PS> & winget upgrade --id=Oracle.VirtualBox -e --uninstall-previous --verbose-logs --logs
A newer version was found, but the install technology is different from the current version installed. Please uninstall the package and install the newer version.
I encountered similar issue when updating VirtualBox for the few previous versions as well. Had to manually uninstall/reeinstall or use force to update. VirtualBox was originally installed/updated using winget.
EDITED: Different but related issue. See https://github.com/microsoft/winget-pkgs/issues/305995.
Just so clarify the scope of this Issue: this is not about the & winget update --all or & winget update --id Oracle.VirtualBox not updating in that scenario. As far as I understand it, that is the expected behaviour or at least a discussion for a separate Issue. This ticket is about the command: & winget update --id Oracle.VirtualBox --uninstall-previous failing to update in that scenario telling you should uninstall the previously installed version first, which makes no sense.
I think the issue with VirtualBox is that the installer is an exe but installs an msi. So this 'install technology is different' thing happens with winget. Issue appears to start around version 7.2 probably due to https://github.com/microsoft/winget-pkgs/pull/291439. So now --uninstall-previous is needed for it but this does not work thus this issue. So two different issues but one leads to the other.
Maybe I'll bring the winget update --all issue to the other repo. I do not think it is expected behaviour since there is no change in installer technology between versions and an application installed with winget itself should be update-able with it without needing to manually update one application specifically with an additional switch.