Skip to content

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

@EriusCalrissian

Description

@EriusCalrissian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-UninstallIssue related to WinGet UninstallIssue-BugIt either shouldn't be doing this or needs an investigation.Needs-TriageIssue needs to be triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions