-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Brief description of your issue
We are using the Winget PowerShell modules in GitHub Actions for scripting. However, we’ve encountered an issue where the PowerShell module throws an exception on the Windows 11 ARM64 desktop image.
Script and Exception
Here’s the script that triggers the exception when invoking the Get-WinGetPackage cmdlet:
if ((Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '17.0.6') {
Write-Host "LLVM 17.0.6 is already installed."
} else {
Write-Host "Installing LLVM 17.0.6..."
Install-WinGetPackage -Id LLVM.LLVM -Version 17.0.6 -Source winget -MatchOption Equals -Mode Silent -Force
}
clang --version
Environment
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
RUSTFLAGS: -D warnings -C target-feature=+crt-static
MSYSTEM: MINGW64
WingetDownloadUri: https://github.com/microsoft/winget-cli/releases/download/v1.11.400/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
WingetLicenseDownloadUri: https://github.com/microsoft/winget-cli/releases/download/v1.11.400/e53e159d00e04f729cc2180cffd1c02e_License1.xml
WingetDependenciesZipUri: https://github.com/microsoft/winget-cli/releases/download/v1.11.400/DesktopAppInstaller_Dependencies.zip
Architecture: arm64
Exception
Fatal error. System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
Repeat 2 times:
--------------------------------
at Microsoft.WinGet.Client.Engine.Helpers.WinRTHelpers.WinGetServerManualActivation_CreateInstance(System.Guid, System.Guid, UInt32, System.Object ByRef)
--------------------------------
at Microsoft.WinGet.Client.Engine.Helpers.WinRTHelpers.ManualActivation(System.Guid, System.Guid, UInt32, System.Object ByRef)
at Microsoft.WinGet.Client.Engine.Helpers.ManagementDeploymentFactory.Create[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Type, System.Guid ByRef)
at Microsoft.WinGet.Client.Engine.Helpers.ManagementDeploymentFactory.CreateCreateCompositePackageCatalogOptions()
at Microsoft.WinGet.Client.Engine.Commands.Common.FinderCommand.GetPackageCatalogReference(Microsoft.Management.Deployment.CompositeSearchBehavior)
at Microsoft.WinGet.Client.Engine.Commands.Common.FinderCommand.GetPackageCatalog(Microsoft.Management.Deployment.CompositeSearchBehavior)
at Microsoft.WinGet.Client.Engine.Commands.Common.FinderCommand.FindPackages(Microsoft.Management.Deployment.CompositeSearchBehavior, UInt32, Microsoft.Management.Deployment.PackageFieldMatchOption)
at Microsoft.WinGet.Client.Engine.Commands.Common.FinderExtendedCommand.FindPackages(Microsoft.Management.Deployment.CompositeSearchBehavior, Microsoft.Management.Deployment.PackageFieldMatchOption)
at Microsoft.WinGet.Client.Engine.Commands.FinderPackageCommand+<>c__DisplayClass2_0.<Get>b__0()
at Microsoft.WinGet.Client.Engine.Commands.Common.ManagementDeploymentCommand.Execute[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Func`1<System.__Canon>)
at Microsoft.WinGet.Client.Engine.Commands.FinderPackageCommand.Get(System.String)
at Microsoft.WinGet.Client.Commands.GetPackageCmdlet.ProcessRecord()
Additional Context
- The Winget installation method we use is defined here
- This approach works without issues on the Windows Server 2022 runner, but fails with the above exception on the Windows 11 ARM64 runner.
- To rule out script issues, we also tried installing Winget using an alternative method via PowerShell Gallery, but encountered the same exception.
Investigation
- Using winget.exe directly works fine without any issues.
- Based on the stack trace, we found that the PowerShell module internally calls
WindowsPackageManagerServer.exe
- We manually attempted to start this executable from the path:
C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.26.400.0_arm64__8wekyb3d8bbwe
and it launched successfully. However, this did not resolve the exception.
This issue appears to be specific to the ARM64 runner, as the same PowerShell module works fine on x64 runners. At this point, we’ve run out of ideas for further investigation and have opened this issue to seek help.
Please note: I only have CLI access to the runner.
I’m open to trying any suggestions or workarounds you might have.
Steps to reproduce
- Setup a windows runner with
windows-11-arm
image - Install winget with this method
- Use winget powershell module. E.g:
(Get-WinGetPackage -Id LLVM -Source winget -MatchOption Equals).InstalledVersion -eq '17.0.6'
- You should see the exception
Expected behavior
Winget powershell modules should work fine.
Actual behavior
Fatal error. System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
Environment
PS C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.26.400.0_arm64__8wekyb3d8bbwe> winget --info
Windows Package Manager v1.11.400
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22631.4890
System Architecture: Arm64
Package: Microsoft.DesktopAppInstaller v1.26.400.0
Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
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
Configuration Modules %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules
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
ProxyCommandLineOptions Disabled
DefaultProxy Disabled