winget-cli: Office upgrade does not work

Brief description of your issue

I have the following package which is listed twice when entering winget upgrade: Microsoft 365 Apps for enterprise [Microsoft.Office] Version 16.0.14527.20234

Every time I enter winget upgrade --all I have the following problem: When winget tries to update the 2 office packages, a window is displayed which is black and has no output but the office icon. After 2-3 min the update probably completes because the window disapears and winget moves on.

After entering winget upgrade the Microsoft 365 Apps is still displayed in the list of upgradeable packages. Maybe the updater for office could be improved as well. (Not only a black window) I also noticed that when I open a Office App and check the version from within the app it displays that it is up to date. So it appears that it is only updated because I use winget.

Steps to reproduce

Install Microsoft Office for Enterprise. execute winget upgrade --all

Expected behavior

The Office packages should be updated.

Actual behavior

The feedback of the update process is bad (black window). After the update it is still listed as upgradable in winget.

Environment

Windows Package Manager v1.1.12986
Windows: Windows.Desktop v10.0.19043.1288
Paket: Microsoft.DesktopAppInstaller v1.16.12986.0

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 7
  • Comments: 20 (4 by maintainers)

Most upvoted comments

This is still an (annoying, occurring repeatedly) issue. Pinning the version cannot be the solution. Any plans to fix this?

We’re close with the release of WinGet 1.5 (it’s in Release Candidate mode). Pinning is a stable feature in WinGet 1.5

Thanks for mentioning pinning. I am using it and it is really a good workaround. I am looking forward for it being included into the regular release. How to use it now?

  1. Install winget preview:
  2. Enable the pinning feature: winget settings This opens a text editor! with the JSON configuration file:
{
    "experimentalFeatures": {
        "pinning": true
    }
}
  1. Use it: winget pin add Microsoft.Office

How does it look like?

> winget -v
v1.5.1361-preview

> winget features
The following experimental features are in progress.
They can be configured through the settings file 'winget settings'.

Feature                       Status   Property                  Link
-------------------------------------------------------------------------------------------------------------
Show Dependencies Information Disabled dependencies              https://aka.ms/winget-settings
Direct MSI Installation       Disabled directMSI                 https://aka.ms/winget-settings
Package Pinning               Enabled  pinning                   https://aka.ms/winget-settings
Uninstall Previous Argument   Disabled uninstallPreviousArgument https://aka.ms/winget-settings
Configuration                 Disabled configuration             https://aka.ms/winget-settings#configuration
Windows Feature Dependencies  Disabled windowsFeature            https://aka.ms/winget-settings

> winget pin list
Name                                      Id                    Version          Source Pin type
------------------------------------------------------------------------------------------------
Microsoft 365 Apps for enterprise - en-us Microsoft.Office      16.0.16227.20318 winget Pinning
VMware Workstation                        VMware.WorkstationPro 16.2.5           winget Pinning

> winget upgrade
No installed package found matching input criteria.
2 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.

The work on pinning should help a little here. At least, you can pin the packages that are causing trouble so winget upgrade --all will skip/ignore the pinned packages.

Office has a very complex installer mechanism, and we’re still working with them on improvements to the installer flow so we can give a better experience with WinGet.

I noticed this today. It looks like winget wants to install the “Current Channel” but we are on the “Monthly Enterprise Channel”

https://learn.microsoft.com/en-us/officeupdates/update-history-microsoft365-apps-by-date

I’m not aware of any way to tell winget to install the Monthly Enterprise Channel. Perhaps one day, it will see which channel you’re on and pull from that.

winget upgrade --all looping update not sucessfull update

image

after period time, even its say successfully installed, image

I think this can be related to this issue, so I did not open a new one. I tried pinning Microsoft.Office just now, got the message No installed package found matching input criteria..

image

Logs from command winget pin add Microsoft.Office

Click to expand
2023-08-09 12:31:36.988 [CORE] WinGet, version [1.5.1881], activity [{A9A0FB4B-6038-4986-81EB-D6DC2120E006}]
2023-08-09 12:31:36.989 [CORE] OS: Windows.Desktop v10.0.22621.1992
2023-08-09 12:31:36.989 [CORE] Command line Args: winget  pin add Microsoft.Office
2023-08-09 12:31:36.989 [CORE] Package: Microsoft.DesktopAppInstaller v1.20.1881.0
2023-08-09 12:31:36.989 [CORE] IsCOMCall:0; Caller: winget-cli
2023-08-09 12:31:36.993 [CLI ] WinGet invoked with arguments: 'pin' 'add' 'Microsoft.Office'
2023-08-09 12:31:36.993 [CLI ] Found subcommand: pin
2023-08-09 12:31:36.993 [CLI ] Found subcommand: add
2023-08-09 12:31:36.995 [CLI ] Leaf command to execute: root:pin:add
2023-08-09 12:31:36.995 [CLI ] Executing command: add
2023-08-09 12:31:37.006 [REPO] Default source requested, multiple sources available, adding all to source references.
2023-08-09 12:31:37.006 [REPO] Adding to source references msstore
2023-08-09 12:31:37.006 [REPO] Adding to source references winget
2023-08-09 12:31:37.007 [REPO] Multiple sources available, creating aggregated source.
2023-08-09 12:31:37.007 [REPO] Adding to aggregated source: msstore
2023-08-09 12:31:37.007 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-08-09 12:31:37.078 [REPO] Response status: 200
2023-08-09 12:31:37.078 [REPO] Sending http GET request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/information
2023-08-09 12:31:37.089 [REPO] Response status: 200
2023-08-09 12:31:37.089 [REPO] Adding to aggregated source: winget
2023-08-09 12:31:37.098 [CORE] Examining extension: PFN = Microsoft.Winget.Source_8wekyb3d8bbwe, ID = IndexDB
2023-08-09 12:31:37.098 [CORE] Found matching extension.
2023-08-09 12:31:37.121 [REPO] Opening SQLite Index for ImmutableRead at 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.809.1041.838_neutral__8wekyb3d8bbwe\Public\index.db'
2023-08-09 12:31:37.121 [SQL ] Opening SQLite connection #1: 'C:\Program Files\WindowsApps\Microsoft.Winget.Source_2023.809.1041.838_neutral__8wekyb3d8bbwe\Public\index.db' [1, 40]
2023-08-09 12:31:37.122 [REPO] Opened SQLite Index with version [1.6], last write [2023-08-09 11:40:00.000]
2023-08-09 12:31:37.383 [REPO] Creating PredefinedInstalledSource with filter [None]
2023-08-09 12:31:37.383 [REPO] Creating new SQLite Index with version [Latest] at ':memory:'
2023-08-09 12:31:37.383 [SQL ] Opening SQLite connection #2: ':memory:' [6, 0]
2023-08-09 12:31:37.410 [REPO] Reading MSI UpgradeCodes
2023-08-09 12:31:37.412 [REPO] Examining ARP entries for Machine | X64
2023-08-09 12:31:37.434 [REPO] Examining ARP entries for Machine | X86
2023-08-09 12:31:37.458 [REPO] Reading MSI UpgradeCodes
2023-08-09 12:31:37.460 [REPO] Examining ARP entries for User | X64
2023-08-09 12:31:37.749 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db'
2023-08-09 12:31:37.749 [SQL ] Opening SQLite connection #3: 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\StoreEdgeFD\installed.db' [2, 0]
2023-08-09 12:31:37.749 [REPO] Opened SQLite Index with version [1.3], last write [2022-08-26 13:57:35.000]
2023-08-09 12:31:37.775 [REPO] Sending http POST request to: https://storeedgefd.dsx.mp.microsoft.com/v9.0/manifestSearch
2023-08-09 12:31:37.787 [REPO] Response status: 200
2023-08-09 12:31:37.791 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db'
2023-08-09 12:31:37.791 [SQL ] Opening SQLite connection #4: 'C:\Users\olav.birkeland\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db' [2, 0]
2023-08-09 12:31:37.791 [REPO] Opened SQLite Index with version [1.3], last write [2023-08-08 13:36:11.000]
2023-08-09 12:31:37.829 [REPO] Downloading manifest
2023-08-09 12:31:37.829 [CORE] WinINet downloading from url: https://cdn.winget.microsoft.com/cache/manifests/m/Microsoft/Office/16.0.16626.20148/be42-Microsoft.Office.yaml
2023-08-09 12:31:37.844 [CORE] Download hash: 107a01ef06db860cddac0317736d6cf7dd71ae1e467c8dd6ecb144308c74c267
2023-08-09 12:31:37.844 [CORE] Download completed.
2023-08-09 12:31:37.845 [REPO] Finding installed package from available package using system reference search: Query:[none] Include:NormalizedNameAndPublisher='microsoft 365 apps for enterprise'+'microsoft corporation'[Exact] Include:NormalizedNameAndPublisher='microsoft365appsforenterprise'+'microsoft'[Exact]
2023-08-09 12:31:37.846 [REPO] Found multiple matches for available package [Microsoft.Office] in source [Microsoft.Winget.Source_8wekyb3d8bbwe] when searching for [Query:[none] Include:NormalizedNameAndPublisher='microsoft 365 apps for enterprise'+'microsoft corporation'[Exact] Include:NormalizedNameAndPublisher='microsoft365appsforenterprise'+'microsoft'[Exact]]
2023-08-09 12:31:37.846 [REPO]   Checking match with package id: O365ProPlusRetail - en-us
2023-08-09 12:31:37.846 [REPO]   Checking match with package id: O365ProPlusRetail - nb-no
2023-08-09 12:31:37.846 [REPO]   Appropriate installed package could not be determined
2023-08-09 12:31:37.846 [CLI ] No app found matching input criteria
2023-08-09 12:31:37.852 [CLI ] Terminating context: 0x8a150014 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\WorkflowBase.cpp:395

Seems winget-cli struggles when an app is listed as installed twice?


Edit: Never mind, it worked if using --id.

image

I see something similar:

Name                                      Id               Version          Available        Source
---------------------------------------------------------------------------------------------------
Microsoft 365 Apps for enterprise - en-us Microsoft.Office 16.0.14931.20858 16.0.15726.20188 winget
1 upgrades available.

This is with Winget v. 1.4.10052.

Office apps themselves indicate that my organization is on the Semi-Annual Enterprise Channel with Office version 2202. So I suspect that the problem has to do with Winget somehow comparing that against what’s available in the Monthly Enterprise Channel v. 2210.

As others have noted, installing/upgrading superficially seems to succeed, but subsequent calls to winget upgrade indicate that the version(s) have not actually changed. I can’t help wondering if this comes down to a permissions issue: in many (most?) organizations, the ability to install/upgrade Office apps requires elevated permissions. Could it be that only IT admins are allowed to perform such upgrades, and that Winget is merely mishandling the fault condition and improperly reporting success?

Update

Name                                          Id                                       Version          Available        Source
-------------------------------------------------------------------------------------------------------------------------------
Microsoft 365 Apps for enterprise - en-us     Microsoft.Office                         16.0.17328.20282 16.0.17531.20046 winget
1 upgrades available.

I’m seeing this with Winget v1.8.924-preview.

My organization is currently using Office version 2402. Same apparent problem as a year ago: Winget does not seem to honor the governing upgrade channel, and therefore makes an inappropriate version comparison, leading to a false mismatch and a noninstallable “upgrade”.

Yes, we’re really frustrated with the state of winget being pushed by default with every win 11 installation, and we’ll have to support this dumpster fire that is this package manager.

Meanwhile, winget PMs are happily getting their christmas bonus and enjoying their holidays. https://github.com/microsoft/winget-cli/issues/1684