Skip to content

Upgrade --uninstall-previous fails when newer version's install technology is different from the current version installed. #4677

Open

Description

@spizacode

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

Activity

  1. github-actions commented on Jul 25, 2024

    @github-actions

    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:

    Note: You can give me feedback by thumbs upping or thumbs downing this comment.

  2. added
    Issue-Bug
    Command-Install
    and removed
    Needs-Triage
    on Jul 25, 2024
  3. denelon commented on Jul 25, 2024

    @denelon
    Collaborator

    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

  4. added
    Needs-Author-Feedback
    on Jul 25, 2024
  5. spizacode commented on Jul 25, 2024

    @spizacode
    Author

    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.

  6. added
    Needs-Attention
    and removed
    Needs-Author-Feedback
    on Jul 25, 2024
  7. denelon commented on Jul 25, 2024

    @denelon
    Collaborator

    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.

  8. denelon commented on Jul 25, 2024

    @denelon
    Collaborator

    What happens with:

    winget upgrade --id=LocalSend.LocalSend -e --uninstall-previous --version 1.15.1

  9. spizacode commented on Jul 25, 2024

    @spizacode
    Author
    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.
    

    WinGet-2024-07-25-18-17-56.383.log

  10. denelon commented on Jul 25, 2024

    @denelon
    Collaborator

    Thanks for sharing the logs.

  11. removed
    Needs-Attention
    on Jul 25, 2024
  12. spizacode commented on Aug 19, 2025

    @spizacode
    Author

    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.
    

    WinGet-2025-08-19-09-24-42.277.log

  13. changed the title [-]Install --uninstall-previous fails with different install technology[/-] [+]Upgrade --uninstall-previous fails when newer version's install technology is different from the current version installed.[/+] on Aug 19, 2025
  14. cjee21 commented on Oct 12, 2025

    @cjee21

    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.

  15. cjee21 commented on Oct 22, 2025

    @cjee21

    EDITED: Different but related issue. See microsoft/winget-pkgs#305995.

  16. spizacode commented on Oct 22, 2025

    @spizacode
    Author

    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.

  17. cjee21 commented on Oct 22, 2025

    @cjee21

    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 microsoft/winget-pkgs#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-InstallIssue-Bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions