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
23.16k stars 1.45k forks source link

WinGet COM Server denies installation of non-UWP apps in Microsoft Store #3936

Open ijgnaig opened 11 months ago

ijgnaig commented 11 months ago

Brief description of your issue

Can't install non-UWP apps in Microsoft Store, for example, Adobe Photoshop and Zoom, Store reports 0x80070005. However they can be installed through winget command line. This is not entirely a Store problem because Microsoft Store was removed and fresh installed countless times and when this happens the following logs are recorded:

Install state changing for product XPFD4T9N395QN6: Pending => Error
Exception Details: System.UnauthorizedAccessException
Function: OnStatusChanged
Source: .\src\Shell\WinStore.App\Acquisition\InstallManager.cs (254)
TaskScheduler.UnobservedTaskException: "Access is denied. (Exception from HRESULT: 0x80070005)".
Exception Details: System.UnauthorizedAccessException
Function: 
Source:  (0)
PackageManager is not available. CheckEnoughSpaceOnPackageVolumeAsync defaults to true
Error Code: Unknown HResult Error code: 0x80000000
Function: CheckEnoughSpaceOnPackageVolumeAsync
Source: .\src\Shell\WinStore.App\Helpers\PackageStatusHelper.cs (741)
Failed to create a WpmInstallerShim instance to reconnect an install.
Exception Details: System.UnauthorizedAccessException
Function: ReconnectAsync
Source: .\src\Shell\WinStore.App\Acquisition\WindowsPackageManagerInstaller.cs (379)
Exception creating Microsoft.Management.Deployment.PackageManager: Access is denied. (Exception from HRESULT: 0x80070005)
Exception Details: System.UnauthorizedAccessException
Function: Reset
Source: .\src\Core\WinStore.Core\Acquisition\PackageManager\WindowsPackageManager.cs (74)

and an empty log file WinGetCOM-XXX.log is created in %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir. Seems that WindowsPackageManagerServer refused the API call for unknown reason

Steps to reproduce

Try to install a non-UWP app in Microsoft Store, like Adobe Photoshop and Zoom

Expected behavior

The app installs with no problem, through both Microsoft Store and winget command line

Actual behavior

Store can't detect if the app is installed because access to package manager's COM server is denied, already installed apps always show a "Install" button, and click on "Install" results in 0x80070005 regardless of it is installed through winget command line or not

Environment

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

Windows: Windows.Desktop v10.0.19045.3693
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3133.0

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ABRIO-PR commented 10 months ago

Hi. I have the same problem. Any solutions?

AlexBychek commented 8 months ago

I also encountered this problem, but it doesn’t install for me even from the console.