Failed installs leave winget versions out of sync with installed versions #3859
Labels
Command-Install
Issue related to WinGet Install
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Needs-Author-Feedback
Issue needs attention from issue or PR author
No-Recent-Activity
Issue has no recent activity
Portable
Issue related to portable package
Milestone
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
The text was updated successfully, but these errors were encountered: