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
22.67k stars 1.4k forks source link

Agreements block `--all` functionality #4301

Open Gilgamech opened 4 months ago

Gilgamech commented 4 months ago

Brief description of your issue

If many packages have an upgrade available, and one has an Agreements section that requires the --accept-package-agreements switch, but this switch isn't provided - then the whole upgrade operation is cancelled, instead of upgrading the packages that don't have Agreements sections.

Steps to reproduce

PS C:\Users\Gilgamech> winget upgrade --all --include-pinned
Name           Id                   Version       Available      Source
-----------------------------------------------------------------------
Git            Git.Git              2.43.0        2.44.0         winget
Microsoft Edge Microsoft.Edge       122.0.2365.92 122.0.2365.106 winget
Shotcut        Meltytech.Shotcut    24.01.28      24.02.29       winget
SourceTree     Atlassian.Sourcetree 3.4.16        3.4.17         winget
Google Chrome  Google.Chrome        123.0.6312.58 123.0.6312.59  winget
5 upgrades available.
1 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.

Agreements for Sourcetree [Atlassian.Sourcetree] Version 3.4.17
Version: 3.4.17
Publisher: Atlassian
Publisher Url: https://www.atlassian.com
Publisher Support Url: https://support.atlassian.com/sourcetree
Author: Atlassian Pty Ltd, Atlassian, Inc.
Homepage: https://www.sourcetreeapp.com
License: Proprietary
License Url: https://www.atlassian.com/legal/software-license-agreement
Privacy Url: https://www.atlassian.com/legal/privacy-policy
Copyright: Copyright (c) 2021 Atlassian Pty Ltd, Atlassian, Inc.
Agreements:
  End User License Agreement (EULA): https://www.atlassian.com/legal/software-license-agreement

Package agreements were not agreed to. Operation cancelled.
3 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.
PS C:\Users\Gilgamech> 

Expected behavior

Of the 5 applications with an upgrade available, I believe only 1 has an Agreements, so the other 4 should be upgraded. Also, the error message should give some remediation tips, such as "Review the Agreement provided above, and if you accept its terms, use --accept-package-agreements to continue with the install."

Actual behavior

Package agreements were not agreed to. Operation cancelled.

Environment

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

Windows: Windows.Desktop v10.0.22631.3296
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.10661.0

Winget Directories                 
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
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                     Disabled
LocalArchiveMalwareScanOverride           Disabled
github-actions[bot] commented 4 months ago

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!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.