microsoft / microsoft/winget-cli
Unable to uninstall zip + portable package if the target exe file is in a subfolder
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
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).
- Run
winget install -m .\a\aria2\aria2\1.36.0\, and WinGet works properly. - 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the portable uninstall workflow at AppInstallerCLICore/Workflows/PortableFlow.cpp and reproduce the issue using the aria2 package and the listed winget install and uninstall commands. Trace why a target executable in a subfolder produces an empty expected symlink target; done means the package uninstalls successfully without --force and without reporting that the portable file was modified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100