Cannot upgrade/uninstall nested portables coming from an older version of WinGet
Brief description of your issue
Nested portable applications where the executable is located inside of a subdirectory in the archive suffered from issue https://github.com/microsoft/winget-cli/issues/2909 that was patched in the preview version of WinGet in PR https://github.com/microsoft/winget-cli/pull/3002. Users can benefit from the patched behavior if they upgrade to the preview version and install these apps for the first time (no prior installation). However, users coming from WinGet 1.4 who already had the package installed need to first uninstall the existing installation or upgrade to a newer version if available to get the correct value in their PATH env variable. The issue is that users are not able to perform an uninstall/upgrade of these apps and the command gets stuck indefinitely.
Steps to reproduce
- Install WinGet version 1.4.10173
- Ensure developer mode is turned off to prevent symlink creation.
- Install apps like
Gyan.FFmpeg,BurntSushi.ripgrep.GNU,Helm.Helmfrom a USER shell (again to prevent symlink creation). Install an older version to test upgrade scenario (e.g.winget install Gyan.ffmpeg --version 5.1.2). If you try to uninstall the apps at this stage, the command would succeed - Upgrade to the preview release WinGet v1.5.1361
- Try to upgrade/uninstall the apps from a user/admin shell.
Expected behavior
Uninstall/Upgrade succeeds
Actual behavior
Command gets stuck indefinitely at Starting package uninstall... / Starting package install... (in upgrade scenario)
Interesting thing to note here is that in the upgrade scenario, the values are actually overwritten in the registry, but the archive isn't extracted properly inside the Packages directory. Here I was upgrading Gyan.FFmpeg from 5.1.2 to 6.0
Workaround
The workaround I found to remove these packages to unblock upgrade/uninstall scenario is:
- Either downgrade to WinGet 1.4 and then uninstall the package
- Or perform a manual uninstall which would mean:
- Delete directory from %LOCALAPPDATA%\Microsoft\WinGet\Packages
- Manually remove the value from PATH variable
- Delete the relevant registry key from
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\
Logs
Logs generated after having to manually Ctrl-C the indefinitely stuck commands
WinGet-2023-05-27-17-03-08.610.log (stuck in upgrade command) WinGet-2023-05-27-17-09-28.883.log (stuck in uninstall command)
Environment
Windows Package Manager (Preview) v1.5.1361-preview
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22621.1702
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.1361.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
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
winget -v
v1.6.3133
same issue.
[Policy] Command-Upgrade [Policy] Command-Uninstall
I'm having the same problem with Gyan.FFmpeg 6.0, trying to install 7.1.1. Winget is v1.10.390.
I was able to manually remove it, like described in the initial issue, then install 7.1.1 with winget afterwards, but before I deleted the package, uninstall entry, and path entry, it would hang like described above.