Failed installs leave winget versions out of sync with installed versions
Brief description of your issue
I've noticed this in the past, but dug in for the first time today. Winget often "hangs", when certain install conditions occur, and the only way to get out of it, is to control+c. When using control+c at certain points of the install, Winget will update the versioning information as if the install was successful - even if the install is not successful. This has both reliability and security implications.
Steps to reproduce
During install, if install hangs, if you control+c on the command line, the installed version will be updated in winget, even if the installed version is not updated:
See example:
(6/12) Found cURL [cURL.cURL] Version 8.4.0.6 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://curl.se/windows/dl-8.4.0_6/curl-8.4.0_6-win64-mingw.zip ██████████████████████████████ 10.0 MB / 10.0 MB Successfully verified installer hash Extracting archive... Successfully extracted archive Starting package install...
;<waited like 10 minutes> ;<control+c>
C:\Users\jedia>winget list --id cURL.cURL Name Id Version Source
cURL cURL.cURL 8.4.0.6 winget
C:\Users\jedia>winget install --id cURL.cURL Found an existing package already installed. Trying to upgrade the installed package... No available upgrade found. No newer package versions are available from the configured sources.
; The installed package is: ; "C:\Users\jedia\AppData\Local\Microsoft\WinGet\Packages\cURL.cURL_Microsoft.Winget.Source_8wekyb3d8bbwe\curl-8.0.1_8-win64-mingw"
; The hang appears to be that winget is selecting the wrong architecture 2023-11-06 13:31:28.906 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/manifests/c/cURL/cURL/8.4.0.6/dc7d 2023-11-06 13:31:29.050 [CORE] Download hash: e92dd26e033e3f4db0fdaa73c4d3f8ea1d665c4cc84d9799f3ee6b1e2789763a 2023-11-06 13:31:29.050 [CORE] Download completed. 2023-11-06 13:31:29.051 [CLI ] Manifest fields: Name [cURL], Version [8.4.0.6] 2023-11-06 13:31:29.060 [CLI ] Starting installer selection. 2023-11-06 13:31:29.061 [CLI ] Installer [Arm64,portable,Unknown,] not applicable: Machine is not compatible with Arm64 2023-11-06 13:31:29.061 [CLI ] Completed installer selection. 2023-11-06 13:31:29.064 [CLI ] Leaf command succeeded: root:show
Expected behavior
Winget file should be selected from the right architecture - however, more importantly, when installation fails, Winget should not record that it was successful.
Actual behavior
When the installation is failing - winget is recording that the installation was successful.
Environment
C:\Users\jedia>winget --info
Windows Package Manager v1.6.2771
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22621.2428
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.2771.0
Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User) %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root C:\Program Files\WinGet\Packages
Portable Package Root (x86) C:\Program Files (x86)\WinGet\Packages
Installer Downloads %USERPROFILE%\Downloads
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
Admin Setting State
--------------------------------------------------
LocalManifestFiles Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride Disabled
LocalArchiveMalwareScanOverride Disabled
I happened to me with a zip-based package (ffmpeg in particular). when I wanted to update 6.0 to 6.1.1. It now lists as version 6.1.1 but the only installed one is actually 6.0. It cannot be upgraded, repaired or uninstalled.
Uninstall hangs forever. There should be a way to repair or clean its data in Winget's DB.
This looks related to:
- #3279
Have you tried any of the workarounds listed in that issue to see if it unblocks the install/upgrade for you?
Hello @idarthjedi,
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.
Template: msftbot/noRecentActivity