KEMBAR78
PowerShell client fails to install certain packages which work with the winget CLI · Issue #4661 · microsoft/winget-cli · GitHub
Skip to content

PowerShell client fails to install certain packages which work with the winget CLI #4661

@fgimian

Description

@fgimian

Brief description of your issue

Installing the yt-dlp.yt-dlp package using the Install-WinGetPackage fails while the winget CLI works as expected.

Steps to reproduce

  1. Install the latest version of the Microsoft.WinGet.Client PowerShell package: Install-Module -Name Microsoft.WinGet.Client
  2. Attempt to install yt-dlp: Install-WinGetPackage -Id yt-dlp.yt-dlp -Scope System

Expected behavior

The package should install successfully.

Actual behavior

The package fails to install with the following output:

Administrator in ~\Downloads
🕙 [ 09:05:30 PM ] ❯ Install-WinGetPackage -Id yt-dlp.yt-dlp -Scope System

Id            Name   Source InstallerErrorCode Status        RebootRequired ExtendedErrorCode                                        C
                                                                                                                                     o
                                                                                                                                     r
                                                                                                                                     r
                                                                                                                                     e
                                                                                                                                     l
                                                                                                                                     a
                                                                                                                                     t
                                                                                                                                     i
                                                                                                                                     o
                                                                                                                                     n
                                                                                                                                     D
                                                                                                                                     a
                                                                                                                                     t
                                                                                                                                     a
--            ----   ------ ------------------ ------        -------------- -----------------                                        -
yt-dlp.yt-dlp yt-dlp winget 0                  DownloadError False          System.Runtime.InteropServices.COMException (0x8A150110)

And please see the relevant WinGetCOM.log log file below:

2024-07-22 21:07:44.042 [CORE] Passed in Correlation Vector Json is invalid: ; Error: * Line 1, Column 1
  Syntax error: value, object or array expected.

2024-07-22 21:07:44.042 [CORE] WinGet, version [1.8.1911], activity [{11B71C78-188B-43B3-9B84-BFF9F64841FA}]
2024-07-22 21:07:44.042 [CORE] OS: Windows.Desktop v10.0.22631.3880
2024-07-22 21:07:44.042 [CORE] Command line Args: C:\Users\Fots\AppData\Local\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\WindowsPackageManagerServer.exe --manualActivation
2024-07-22 21:07:44.042 [CORE] Package: Microsoft.DesktopAppInstaller v1.23.1911.0
2024-07-22 21:07:44.042 [CORE] IsCOMCall:1; Caller: C:\Program Files\PowerShell\7\pwsh.exe
2024-07-22 21:07:44.049 [CLI ] Executing command: download
2024-07-22 21:07:44.049 [REPO] Creating new SQLite Index with version [Latest] at ':memory:'
2024-07-22 21:07:44.053 [REPO] Reading MSI UpgradeCodes
2024-07-22 21:07:44.299 [REPO] Reading MSI UpgradeCodes
2024-07-22 21:07:45.531 [REPO] Opening database for ReadWrite at 'C:\Users\Fots\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db'
2024-07-22 21:07:45.533 [REPO] Opened SQLite Index with version [1.7], last write [2024-07-21 12:17:28.000]
2024-07-22 21:07:46.730 [REPO] Attempting to open pinning database: C:\Users\Fots\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\pinning.db
2024-07-22 21:07:46.731 [CLI ] Manifest fields: Name [FFmpeg], Version [7.0.1]
2024-07-22 21:07:47.903 [CLI ] Found existing installer file at 'C:\Users\Fots\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\ffmpeg-7.0.1-full_build.zip'. Verifying file hash.
2024-07-22 21:07:48.708 [CLI ] Existing installer file hash matches. Will use existing installer.
2024-07-22 21:07:48.708 [CLI ] Installer hash verified
2024-07-22 21:07:48.708 [CORE] Started applying motw to C:\Users\Fots\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\ffmpeg-7.0.1-full_build.zip with zone: 2
2024-07-22 21:07:48.709 [CORE] Finished applying motw
2024-07-22 21:07:48.824 [CLI ] Extracting archive to: C:\Users\Fots\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\extracted
2024-07-22 21:07:56.305 [CLI ] Successfully extracted archive
2024-07-22 21:07:56.414 [REPO] Opening database for ReadWrite at 'C:\Program Files\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe.db'
2024-07-22 21:07:56.415 [REPO] Opened Portable Index with version [1.0], last write [2024-07-22 21:06:06.000]
2024-07-22 21:07:56.418 [REPO] Opening database for ReadWrite at 'C:\Program Files\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe.db'
2024-07-22 21:07:56.418 [REPO] Opened Portable Index with version [1.0], last write [2024-07-22 21:06:06.000]
2024-07-22 21:07:56.418 [CLI ] Removing directory at C:\Program Files\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-7.0.1-full_build
2024-07-22 21:07:56.473 [CLI ] Deleting portable symlink at: C:\Program Files\WinGet\Links\ffmpeg.exe
2024-07-22 21:07:56.477 [CLI ] Deleting portable symlink at: C:\Program Files\WinGet\Links\ffplay.exe
2024-07-22 21:07:56.481 [CLI ] Deleting portable symlink at: C:\Program Files\WinGet\Links\ffprobe.exe
2024-07-22 21:07:56.485 [CLI ] Portable index deleted: C:\Program Files\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe.db
2024-07-22 21:07:56.485 [REPO] Creating new Portable Index with version [Latest] at 'C:\Program Files\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe.db'
2024-07-22 21:07:56.501 [CORE] Renaming directory to: C:\Program Files\WinGet\Packages\Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe\ffmpeg-7.0.1-full_build
2024-07-22 21:07:56.506 [CORE] Symlink created at: C:\Program Files\WinGet\Links\ffmpeg.exe
2024-07-22 21:07:56.510 [CORE] Symlink created at: C:\Program Files\WinGet\Links\ffplay.exe
2024-07-22 21:07:56.514 [CORE] Symlink created at: C:\Program Files\WinGet\Links\ffprobe.exe
2024-07-22 21:07:56.514 [CLI ] Portable target directory already exists in PATH registry: C:\Program Files\WinGet\Links
2024-07-22 21:07:56.519 [REPO] Opening database for ReadWrite at 'C:\Users\Fots\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.db'
2024-07-22 21:07:56.520 [REPO] Opened SQLite Index with version [1.7], last write [2024-07-21 12:17:28.000]
2024-07-22 21:07:57.911 [CLI ] Removing installer: C:\Users\Fots\AppData\Local\Temp\WinGet\Gyan.FFmpeg.7.0.1\extracted
2024-07-22 21:07:59.102 [CLI ] Found existing installer file at 'C:\Users\Fots\AppData\Local\Temp\WinGet\yt-dlp.yt-dlp.2024.07.16\yt-dlp.exe'. Verifying file hash.
2024-07-22 21:07:59.205 [CLI ] Existing installer file hash matches. Will use existing installer.
2024-07-22 21:07:59.205 [CLI ] Installer hash verified
2024-07-22 21:07:59.205 [CORE] Started applying motw to C:\Users\Fots\AppData\Local\Temp\WinGet\yt-dlp.yt-dlp.2024.07.16\yt-dlp.exe with zone: 2
2024-07-22 21:07:59.207 [CORE] Finished applying motw
2024-07-22 21:07:59.207 [CLI ] Executing command: install
2024-07-22 21:07:59.207 [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCLICore\ExecutionContext.cpp(456)\WindowsPackageManager.dll!00007FFD345DCA12: (caller: 00007FFD3467D93E) Exception(6) tid(2914) 8007139F The group or resource is not in the correct state to perform the requested operation.

    Msg:[Reporting ExecutionStage to an earlier Stage without allowBackward as true] 

2024-07-22 21:07:59.208 [CLI ] Caught wil::ResultException: C:\__w\1\s\external\pkg\src\AppInstallerCLICore\ExecutionContext.cpp(456)\WindowsPackageManager.dll!00007FFD345DCA12: (caller: 00007FFD3467D93E) Exception(6) tid(2914) 8007139F The group or resource is not in the correct state to perform the requested operation.

    Msg:[Reporting ExecutionStage to an earlier Stage without allowBackward as true] 

2024-07-22 21:07:59.209 [CLI ] Successfully refreshed process PATH environment variable.
2024-07-22 21:07:59.209 [CLI ] Terminating context: 0x8a150110 at C:\__w\1\s\external\pkg\src\AppInstallerCLICore\Workflows\InstallFlow.cpp:319

The winget CLI works just fine:

Administrator in ~\Downloads took 18s
🕙 [ 09:09:41 PM ] ❯ winget install yt-dlp.yt-dlp --scope machine
Found yt-dlp [yt-dlp.yt-dlp] Version 2024.07.16
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
This package requires the following dependencies:
  - Packages
      Gyan.FFmpeg
(1/1) Found FFmpeg [Gyan.FFmpeg] Version 7.0.1
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Extracting archive...
Successfully extracted archive
Starting package install...
Command line alias added: "ffmpeg"
Command line alias added: "ffplay"
Command line alias added: "ffprobe"
Successfully installed

Successfully verified installer hash
Starting package install...
Command line alias added: "yt-dlp"
Successfully installed

Environment

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

Windows: Windows.Desktop v10.0.22631.3880
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.23.1911.0

PowerShell modules are listed below:

Name                            Version
----                            -------
Microsoft.PowerShell.Management 7.0.0.0
Microsoft.PowerShell.Utility    7.0.0.0
Microsoft.WinGet.Client         1.8.1911
posh-git                        1.1.0
PSReadLine                      2.2.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-InstallIssue related to WinGet InstallIn-PRIssue related to a PRIssue-BugIt either shouldn't be doing this or needs an investigation.PowerShellIssue related to WinGet PowerShell Module or cmdlet

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions