Skip to content

Unable to remove packages from pinned list if package is uninstalled. #4161

Closed

Description

@sagar297

Brief description of your issue

Unable to remove packages from pinned list if package is uninstalled.

Steps to reproduce

winget install Stockfish.Stockfish
winget pin add Stockfish.Stockfish
winget remove Stockfish.Stockfish
winget pin remove Stockfish.Stockfish

Expected behavior

Remove package from the pinned list.

Actual behavior

Doesn't removes package from the pinned list and returns "No installed package found matching input criteria."

Environment

Windows Package Manager (Preview) v1.7.3481-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.26040.1000
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.3481.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
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                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Enabled
LocalArchiveMalwareScanOverride           Disabled
### Tasks

Activity

  1. mdanish-kh commented on Feb 11, 2024

    @mdanish-kh
    Contributor

    Try providing the --id flag. I'm not sure about the exact behavior but I'm guessing pinning tries to match the query to the list of "installed" applications without this flag.

    winget pin remove --id Stockfish.Stockfish
    

    This appears to be a bug. I would expect if the query is an exact match for a PackageIdentifier, it should just be removed irrespective of the package being installed.

  2. sagar297 commented on Feb 11, 2024

    @sagar297
    Author

    Try providing the --id flag. I'm not sure about the exact behavior but I'm guessing pinning tries to match the query to the list of "installed" applications without this flag.

    winget pin remove --id Stockfish.Stockfish
    

    This appears to be a bug. I would expect if the query is an exact match for a PackageIdentifier, it should just be removed irrespective of the package being installed.

    Pin is removed when using --id flag though it should work without the flag.

  3. mdanish-kh commented on Feb 11, 2024

    @mdanish-kh
    Contributor

    I created #4163 for this request. Is it okay if I close this one in favor of the linked issue for better tracking?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-Pin

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions