microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.4k stars 1.46k forks source link

winget pin won't pin packages with unknown version #3965

Open dgulik opened 11 months ago

dgulik commented 11 months ago

Brief description of your issue

winget pin will not recognize or add packages which have an unknown version

Steps to reproduce

C:\Users\derri>winget add pin Lounge Lizard Session 4 No package found matching input criteria. Package not found: Lounge Multiple packages found matching input criteria. Please refine the input. Name Id Source

Session Keeper 9NBLGGH2RVQZ msstore Session Oxen.Session winget Multiple packages found for: Session

Expected behavior

would expect these and other packages with similar statuses to be added to the pin list. Maybe this should be a feature request to exclude these packages from upgrades

Actual behavior

does not pin packages with unknown versions

Environment

Windows Package Manager v1.6.3133
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.2792
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3133.0
Trenly commented 11 months ago

I see a few separate items that could be causing issues in the commands you tried.


winget add pin Lounge Lizard Session 4
No package found matching input criteria.
Package not found: Lounge

This seems to be an issue with not using quotes when the package name has spaces. Try this - winget pin add 'Lounge Lizard Session 4'


Multiple packages found matching input criteria. Please refine the input.
Name Id Source
Session Keeper 9NBLGGH2RVQZ msstore
Session Oxen.Session winget
Multiple packages found for: Session

It seems you have multiple packages installed that matched your query. Try using the ID instead - winget pin add 9NBLGGH2RVQZ or winget pin add Oxen.Session

dgulik commented 11 months ago

I tried with quotes and received the following: C:\Users\derri>winget pin add 'Lounge Lizard Session 4' Windows Package Manager v1.6.3133 Copyright (c) Microsoft Corporation. All rights reserved.

Found a positional argument when none was expected: 'Lizard'

I also got the positional argument for the word Lizard regardless of what command was used.

I think(maybe) the issue may be that some of the packages listed as having unknown versions are virtual instruments(VSTs used for audio recording) and the other packages that can't be pinned are executables that are run on an as-needed basis.

No big deal really. Thanks for your help.

On Sun, Dec 10, 2023 at 6:40 PM Kaleb Luedtke @.***> wrote:

I see a few separate items that could be causing issues in the commands you tried.

winget add pin Lounge Lizard Session 4 No package found matching input criteria. Package not found: Lounge

This seems to be an issue with not using quotes when the package name has spaces. Try this - winget pin add 'Lounge Lizard Session 4'

Multiple packages found matching input criteria. Please refine the input. Name Id Source Session Keeper 9NBLGGH2RVQZ msstore Session Oxen.Session winget Multiple packages found for: Session

It seems you have multiple packages installed that matched your query. Try using the ID instead - winget pin add 9NBLGGH2RVQZ or winget pin add Oxen.Session

— Reply to this email directly, view it on GitHub https://github.com/microsoft/winget-cli/issues/3965#issuecomment-1849153614, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALU3DENYRHBPK2UL7CDR3ALYIZI67AVCNFSM6AAAAABAO43L6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGE2TGNRRGQ . You are receiving this because you authored the thread.Message ID: @.***>

denelon commented 11 months ago

Packages that don't report their version to the registry are tricky for WinGet to handle as it can't determine if a newer package is an upgrade or not. Pinning only prevents upgrades via WinGet, they can still update themselves, and packages in the Microsoft Store will also automatically become updated by the Microsoft Store.

WinGet doesn't attempt to upgrade packages with an unknown version.