winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Unable to uninstall zip + portable package if the target exe file is in a subfolder

Open SpecterShell opened this issue 3 years ago • 0 comments

Brief description of your issue

For zip + portable packages, if the target executable file is in a subfolder of the zip archive, WinGet will always report the portable package has been modified and thus can't be uninstalled.

Steps to reproduce

Take https://github.com/microsoft/winget-pkgs/pull/92285 as an example, whose executable file is in the subfolder aria2-1.36.0-win-64bit-build1 (x64) or aria2-1.36.0-win-32bit-build1 (x86).

  1. Run winget install -m .\a\aria2\aria2\1.36.0\, and WinGet works properly.
  2. Run winget uninstall aria2.aria2__DefaultSource.

Expected behavior

WinGet should be able to uninstall the package.

Actual behavior

WinGet cannot uninstall the package and reports Unable to remove Portable package as it has been modified; to override this check use --force.

Log:

2022-12-28 17:06:56.440 [CLI ] Found one app. App id: aria2.aria2__DefaultSource App name: aria2
2022-12-28 17:06:56.447 [CLI ] Symlink target does not match ARP Entry. Expected:  Actual: C:\Users\SpecterShell\AppData\Local\Microsoft\WinGet\Packages\aria2.aria2__DefaultSource\aria2-1.36.0-win-64bit-build1\aria2c.exe
2022-12-28 17:06:56.447 [CLI ] Portable file has been modified: C:\Users\SpecterShell\AppData\Local\Microsoft\WinGet\Links\aria2c.exe
2022-12-28 17:06:56.448 [CLI ] Terminating context: 0x8a150057 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\PortableFlow.cpp:12f

Environment

Windows 程序包管理器 v1.4.3531
版权所有 (C) Microsoft Corporation。保留所有权利。

Windows: Windows.Desktop v10.0.22621.963
系统体系结构: X64
软件包: Microsoft.DesktopAppInstaller v1.19.3531.0

日志: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

用户设置: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

SpecterShell avatar Dec 28 '22 09:12 SpecterShell