microsoft / microsoft/winget-cli

Portable uninstall removes symlinks belonging to a different package when binary names collide

Open
#6,215 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Uninstall Issue-Bug Portable
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.FFmpeg is installed and creates symlinks ffmpeg.exe, ffplay.exe, ffprobe.exe in C:\Users\<User>\AppData\Local\Microsoft\WinGet\Links.
  • yt-dlp.FFmpeg is then installed. Because its manifest sets ArchiveBinariesDependOnPath: 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 the yt-dlp.FFmpeg install directory, reports the package as modified, and (with --force) deletes the symlinks – which actually belong to Gyan.FFmpeg.
Steps to reproduce
  1. Make sure the …\WinGet\Links folder contains no ffmpeg.exe, ffplay.exe, or ffprobe.exe.
  2. Install Gyan.FFmpeg (use admin shell):
    winget install --id Gyan.FFmpeg
    
    Confirm that ffmpeg.exe, ffplay.exe, ffprobe.exe symlinks appear in C:\Users\<User>\AppData\Local\Microsoft\WinGet\Links and point into the Gyan.FFmpeg package directory.
  3. Install yt-dlp.FFmpeg (which uses ArchiveBinariesDependOnPath: true):
    winget install --id yt-dlp.FFmpeg
    
    Confirm that no new symlinks are created (as expected for this manifest).
  4. Uninstall yt-dlp.FFmpeg:
    winget uninstall --id yt-dlp.FFmpeg
    
  5. Observe the "package has been modified" warning. Re-run with --force:
    winget uninstall --id yt-dlp.FFmpeg --force
    
  6. Check C:\Users\<User>\AppData\Local\Microsoft\WinGet\Links and observe that the Gyan.FFmpeg symlinks have been deleted, even though Gyan.FFmpeg is 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: true should 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.FFmpeg should remove only files/registry entries owned by yt-dlp.FFmpeg (the extracted archive directory and its portable ARP entry), without producing a "package has been modified" warning and without touching symlinks created by Gyan.FFmpeg.
Actual behavior
  • Winget matches symlinks in …\WinGet\Links to 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.FFmpeg install directory, winget reports Symlink target does not match ARP Entry / Portable file has been modified and refuses to uninstall without --force.
  • When --force is used, winget deletes the ffmpeg.exe, ffplay.exe, and ffprobe.exe symlinks that actually belong to Gyan.FFmpeg, leaving Gyan.FFmpeg installed but with its PATH-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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.