Repository navigation
Description
Brief description of your issue
As seen in #4161 (comment), winget pin remove does not remove pin for an uninstalled application without providing --id flag. I would expect that if the query is an exact / good enough match for a PackageIdentifier listed in winget pin list, then winget pin remove <PackageIdentifier> should just work.
The same extension can be made for winget pin add where a non-installed application can not be pinned without --id flag. A matching criteria similar to the one used for winget install/search can be followed to allow these pins.
If we're concerned about user pinning / unpinning an incorrect package with these enhancements, we can make the flow interactive and ask user in a (y/n) prompt.
Steps to reproduce
From #4161 (comment)
winget install Stockfish.Stockfish
winget pin add Stockfish.Stockfish
winget remove Stockfish.Stockfish
winget pin remove Stockfish.Stockfish
Expected behavior
Pin removed successfully
Actual behavior
No installed package found matching input criteria.
Environment
Windows Package Manager v1.6.3482
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22621.3007
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3482.0
Winget Directories
----------------------------------------------------------------------------------------------------------
Logs %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Lo…
User Settings %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Lo…
Portable Links Directory (User) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User) %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root C:\Program Files\WinGet\Packages
Portable Package Root (x86) C:\Program Files (x86)\WinGet\Packages
Installer Downloads %USERPROFILE%\Downloads
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
Admin Setting State
--------------------------------------------------
LocalManifestFiles Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride Enabled
LocalArchiveMalwareScanOverride Enabled
Activity
github-actions commentedon Feb 11, 2024
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Closed similar issues:
--idshould bypass installed package check (#3141), similarity score: 0.78mdanish-kh commentedon Feb 11, 2024
Thinking more -
I don't feel as strongly about
winget pin addsince there may be questions as to why user would want to pin a package that's not installed. If they really want to do it,--idallows them to add that pin.However for
winget pin remove, if a pin is already inwinget pin list, then the user should be able to remove it without--idmasterflitzer commentedon Apr 17, 2025
to prevent misdetection, e.g. i pinned Mozilla.Thunderbird which i have installed, but one day
upgrade -rjust installed Mozilla.Thunderbird.ESR for some reason, so i'd rather be able to pin both while having only the one i actually want installedbut i also don't feel strongly about this, what i do think is important tho:
winget pin add -?should say that--idcan do this, it's the kind of hidden behavior i wouldn't have found out without you mentioning itthis wouldn't be a problem if
winget pin remove -?would say that--idcan do that