microsoft / microsoft/winget-cli
Portable uninstall removes symlinks belonging to a different package when binary names collide
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Relevant area(s)
WinGet CLI
Relevant command(s)
winget uninstall
Brief description of your issue
When two portable packages provide binaries with identical filenames (e.g. ffmpeg.exe, ffplay.exe, ffprobe.exe) and one of them is installed with ArchiveBinariesDependOnPath: true (so it does not create symlinks in …\WinGet\Links), winget incorrectly associates the symlinks created by the other package with the one being uninstalled. This causes a false "package has been modified" warning, and using --force deletes symlinks that belong to a completely different, still-installed package.
In my concrete case:
Gyan.FFmpegis installed and creates symlinksffmpeg.exe,ffplay.exe,ffprobe.exeinC:\Users\<User>\AppData\Local\Microsoft\WinGet\Links.yt-dlp.FFmpegis then installed. Because its manifest setsArchiveBinariesDependOnPath: true, it correctly does not create any symlinks.- When uninstalling
yt-dlp.FFmpeg, winget nevertheless inspects the existing symlinks in…\WinGet\Links, sees they don't point into theyt-dlp.FFmpeginstall directory, reports the package as modified, and (with--force) deletes the symlinks – which actually belong toGyan.FFmpeg.
Steps to reproduce
- Make sure the
…\WinGet\Linksfolder contains noffmpeg.exe,ffplay.exe, orffprobe.exe. - Install Gyan.FFmpeg (use admin shell):
Confirm thatwinget install --id Gyan.FFmpegffmpeg.exe,ffplay.exe,ffprobe.exesymlinks appear inC:\Users\<User>\AppData\Local\Microsoft\WinGet\Linksand point into theGyan.FFmpegpackage directory. - Install yt-dlp.FFmpeg (which uses
ArchiveBinariesDependOnPath: true):
Confirm that no new symlinks are created (as expected for this manifest).winget install --id yt-dlp.FFmpeg - Uninstall yt-dlp.FFmpeg:
winget uninstall --id yt-dlp.FFmpeg - Observe the "package has been modified" warning. Re-run with
--force:winget uninstall --id yt-dlp.FFmpeg --force - Check
C:\Users\<User>\AppData\Local\Microsoft\WinGet\Linksand observe that theGyan.FFmpegsymlinks have been deleted, even thoughGyan.FFmpegis still installed.
Relevant log excerpt:
[CLI ] Found one app. App id: yt-dlp.FFmpeg App name: FFmpeg for yt-dlp
[CLI ] Symlink target does not match ARP Entry.
Expected: C:\Users\<User>\AppData\Local\Microsoft\WinGet\Packages\yt-dlp.FFmpeg__DefaultSource\ffmpeg-N-124279-g0f6ba39122-win64-gpl\bin\ffmpeg.exe
Actual: C:\Users\<User>\AppData\Local\Microsoft\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-8.1.1-full_build\bin\ffmpeg.exe
[CLI ] Portable file has been modified: C:\Users\<User>\AppData\Local\Microsoft\WinGet\Links\ffmpeg.exe
[CLI ] Deleting portable symlink at: C:\Users\<User>\AppData\Local\Microsoft\WinGet\Links\ffmpeg.exe
[CLI ] Deleting portable symlink at: C:\Users\<User>\AppData\Local\Microsoft\WinGet\Links\ffplay.exe
[CLI ] Deleting portable symlink at: C:\Users\<User>\AppData\Local\Microsoft\WinGet\Links\ffprobe.exe
Expected behavior
- A package installed with
ArchiveBinariesDependOnPath: trueshould not be tracked against any symlinks in…\WinGet\Links, since it never created any. - Uninstalling such a package must never inspect, claim ownership of, or delete symlinks belonging to a different installed package.
winget uninstall --id yt-dlp.FFmpegshould remove only files/registry entries owned byyt-dlp.FFmpeg(the extracted archive directory and its portable ARP entry), without producing a "package has been modified" warning and without touching symlinks created byGyan.FFmpeg.
Actual behavior
- Winget matches symlinks in
…\WinGet\Linksto the package being uninstalled purely by filename, even though that package never created the symlinks (ArchiveBinariesDependOnPath: true). - Because the symlink targets don't point into the
yt-dlp.FFmpeginstall directory, winget reportsSymlink target does not match ARP Entry/Portable file has been modifiedand refuses to uninstall without--force. - When
--forceis used, winget deletes theffmpeg.exe,ffplay.exe, andffprobe.exesymlinks that actually belong toGyan.FFmpeg, leavingGyan.FFmpeginstalled but with itsPATH-exposed entry points silently broken.
Environment
Windows-Paket-Manager v1.28.240
Windows: Windows.Desktop v10.0.26200.8246
Systemarchitektur: X64
Paket: Microsoft.DesktopAppInstaller v1.28.240.0
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 at the winget uninstall command and reproduce the interaction between Gyan.FFmpeg and yt-dlp.FFmpeg using the listed install and uninstall commands, paying attention to ArchiveBinariesDependOnPath. Done means uninstalling yt-dlp.FFmpeg does not inspect or delete Gyan.FFmpeg's symlinks, does not report a modification warning, and removes only yt-dlp.FFmpeg files and registry entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100