Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winget upgrade --include-pinned does not include pinned packages #2975

Closed
Trenly opened this issue Feb 16, 2023 · 4 comments · Fixed by #3173
Closed

winget upgrade --include-pinned does not include pinned packages #2975

Trenly opened this issue Feb 16, 2023 · 4 comments · Fixed by #3173
Labels
Command-Pin Issue related to WinGet Pin Command-Upgrade Issue related to WinGet Upgrade In-PR Issue related to a PR Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@Trenly
Copy link
Contributor

Trenly commented Feb 16, 2023

Brief description of your issue

Winget upgrade reports that packages have pins preventing upgrade. Running the command again with --include-pinned does not show any additional results, despite me knowing for a fact that at least one pinned package has an upgrade available.

Steps to reproduce

Ensure a package reports that it is available for upgrade, such as Microsoft.Office
Pin the package
Run winget upgrade - Note that the message indicating pinned packages are present for upgrade is shown
Run winget upgrade --include-pinned - Note that the pinned package is still not shown

Expected behavior

Packages with pins to be shown for upgrade when --include-pinned is used

Actual behavior

Upgrade - WinGet-2023-02-15-20-54-39.452.log
Upgrade include Pinned - WinGet-2023-02-15-20-54-59.275.log
List Windows SDK - WinGet-2023-02-15-20-55-32.447.log
List Office - WinGet-2023-02-15-20-55-55.297.log

PS C:\WINDOWS\system32> winget upgrade
Name                                                   Id                            Version       Available     Source
-----------------------------------------------------------------------------------------------------------------------
CCleaner                                               Piriform.CCleaner             6.08          6.08.10255    winget
Git                                                    Git.Git                       2.39.1        2.39.2        winget
Microsoft Edge                                         Microsoft.Edge                110.0.1587.41 110.0.1587.46 winget
OBS Studio                                             OBSProject.OBSStudio          28.1.2        29.0.2        winget
Microsoft ASP.NET Core 6.0.13 - Shared Framework (x86) Microsoft.DotNet.AspNetCore.6 6.0.13        6.0.14        winget
5 upgrades available.
1 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.
5 package(s) have pins that prevent upgrade. Use the 'winget pin' command to view and edit pins. Using the --include-pinned argument may show more results.
PS C:\WINDOWS\system32> winget upgrade --include-pinned
Name                                                   Id                            Version       Available     Source
-----------------------------------------------------------------------------------------------------------------------
CCleaner                                               Piriform.CCleaner             6.08          6.08.10255    winget
Git                                                    Git.Git                       2.39.1        2.39.2        winget
Microsoft Edge                                         Microsoft.Edge                110.0.1587.41 110.0.1587.46 winget
OBS Studio                                             OBSProject.OBSStudio          28.1.2        29.0.2        winget
Microsoft ASP.NET Core 6.0.13 - Shared Framework (x86) Microsoft.DotNet.AspNetCore.6 6.0.13        6.0.14        winget
5 upgrades available.
1 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.
5 package(s) have pins that prevent upgrade. Use the 'winget pin' command to view and edit pins. Using the --include-pinned argument may show more results.
PS C:\WINDOWS\system32> winget list "Windows Software Development"
Name                                                      Id                   Version          Available    Source
-------------------------------------------------------------------------------------------------------------------
Windows Software Development Kit - Windows 10.0.19041.685 Microsoft.WindowsSDK < 10.0.22000.832 10.0.22621.2 winget
Windows Software Development Kit - Windows 10.0.22621.755 Microsoft.WindowsSDK 10.0.22621.2                  winget
Windows Software Development Kit - Windows 10.0.22000.832 Microsoft.WindowsSDK 10.0.22000.832   10.0.22621.2 winget
Windows Software Development Kit - Windows 10.0.26624     Microsoft.WindowsSDK < 10.0.22000.832 10.0.22621.2 winget
PS C:\WINDOWS\system32> winget list Office
Name                                                        Id                                                          Version             Available        Source
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft 365 Apps for enterprise - en-us                   Microsoft.Office                                            16.0.15601.20456    16.0.15928.20196 winget

image

Environment

PS C:\WINDOWS\system32> winget --info
Windows Package Manager (Preview) v1.5.441-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.2486
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.441.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

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                     Disabled
LocalArchiveMalwareScanOverride           Disabled
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Feb 16, 2023
@stephengillie stephengillie added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Feb 16, 2023
@Trenly
Copy link
Contributor Author

Trenly commented Feb 16, 2023

After looking at this more, I realize it may be because the pin types are "Blocking" pins. I would think they should still be listed, though, as it seems to be bad UX to never inform the user of an upgrade, even if they've chosen to require the pin to be removed before upgrade. Especially given that there is a string especially for this purpose -

  <data name="UpgradeBlockingPinCount" xml:space="preserve">
    <value>{0} package(s) have a blocking pin that needs to be removed before upgrade</value>
    <comment>{Locked="{0}"} {0} is a placeholder that is replaced by an integer number of packages with blocking pins</comment>
  </data>
PS C:\WINDOWS\system32> winget pin list
Id                         Source Version
------------------------------------------
Microsoft.Office           winget Pinning
Microsoft.WindowsSDK       winget Blocking
Piriform.CCleaner.ProTrial winget Pinning
PS C:\WINDOWS\system32> winget upgrade
Name                                                   Id                            Version       Available     Source
-----------------------------------------------------------------------------------------------------------------------
Microsoft Edge                                         Microsoft.Edge                110.0.1587.41 110.0.1587.46 winget
OBS Studio                                             OBSProject.OBSStudio          28.1.2        29.0.2        winget
Microsoft ASP.NET Core 6.0.13 - Shared Framework (x86) Microsoft.DotNet.AspNetCore.6 6.0.13        6.0.14        winget
3 upgrades available.
1 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.
6 package(s) have pins that prevent upgrade. Use the 'winget pin' command to view and edit pins. Using the --include-pinned argument may show more results.
PS C:\WINDOWS\system32> winget upgrade --include-pinned
Name                                                   Id                            Version          Available        Source
-----------------------------------------------------------------------------------------------------------------------------
CCleaner                                               Piriform.CCleaner             6.08             6.08.10255       winget
Microsoft Edge                                         Microsoft.Edge                110.0.1587.41    110.0.1587.46    winget
Microsoft 365 Apps for enterprise - en-us              Microsoft.Office              16.0.15601.20456 16.0.15928.20196 winget
OBS Studio                                             OBSProject.OBSStudio          28.1.2           29.0.2           winget
Microsoft ASP.NET Core 6.0.13 - Shared Framework (x86) Microsoft.DotNet.AspNetCore.6 6.0.13           6.0.14           winget
5 upgrades available.
1 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.
4 package(s) have pins that prevent upgrade. Use the 'winget pin' command to view and edit pins. Using the --include-pinned argument may show more results.

@florelis
Copy link
Member

Huh, looks like I completely forgot to use that string.

You can get the actual latest available versions with winget list. As you say, it is not shown on winget upgrade --include-pinned because the pins are blocking. My thinking was that winget upgrade would show exactly what you'd get if you did the upgrade. Since you wouldn't get the upgrades with blocking upgrades when you do winget upgrade --all --include-pinned, I decided to not show them there.

Maybe that is not an intuitive behavior.

@Trenly
Copy link
Contributor Author

Trenly commented Feb 16, 2023

Maybe when --include-pinned is used, blocking pins could be shown in a separate table (with the string :P) kind of like the ones which require explicit upgrade are?

@Trenly
Copy link
Contributor Author

Trenly commented Feb 16, 2023

Also, when the --include-pinned argument is used, the output probably shouldn't contain

Using the --include-pinned argument may show more results.

@denelon denelon added the Command-Upgrade Issue related to WinGet Upgrade label Feb 21, 2023
@florelis florelis added the Command-Pin Issue related to WinGet Pin label Apr 12, 2023
@denelon denelon added this to the v1.5-Client milestone Apr 18, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR Issue related to a PR label Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-Pin Issue related to WinGet Pin Command-Upgrade Issue related to WinGet Upgrade In-PR Issue related to a PR Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants