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

Cannot install MSIX packages with WinGet on Windows Sandbox (Exit code: 0x80070002) #4982

Open mdanish-kh opened 1 week ago

mdanish-kh commented 1 week ago

Brief description of your issue

Installing an MSIX app through WinGet on Windows Sandbox fails with Installer failed with exit code: 0x80070002 : The system cannot find the file specified. Note that manually installing the MSIX or using Add-AppxPackage works correctly. The only exception I've found is Microsoft.VCLibs. One can install WinGet 1.6 on Sandbox (that uses an older VCLibs) and then run winget upgrade Microsoft.VCLibs and it'll successfully install the MSIX package. There may be more exceptions, but this is the only one I've found thus far

Steps to reproduce

  1. Install WinGet on Windows Sandbox
  2. Install an MSIX App like Microsoft.WindowsTerminal or any other

Expected behavior

MSIX app installs successfully

Actual behavior

Installer failed with exit code: 0x80070002 : The system cannot find the file specified.

Installer installs successfully with Add-AppxPackage though

Verbose logs

WinGet-2024-11-18-01-51-31.815.log

Seems to fail at the deployment at

2024-11-18 01:51:37.424 [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(54)\WindowsPackageManager.dll!00007FFD6F7FCA3B: (caller: 00007FFD6F7FB1C1) Exception(2) tid(1850) 80073CF1 Package was not found.

    Msg:[Operation failed: Windows cannot remove Microsoft.WindowsTerminal_3001.21.2911.0_neutral_~_8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed.] 

2024-11-18 01:51:37.424 [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(186)\WindowsPackageManager.dll!00007FFD6F93EAB5: (caller: 00007FFD6F7F7F63) LogHr(3) tid(1850) 80073CF1 Package was not found.

    Msg:[C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(54)\WindowsPackageManager.dll!00007FFD6F7FCA3B: (caller: 00007FFD6F7FB1C1) Exception(2) tid(1850) 80073CF1 Package was not found.

    Msg:[Operation failed: Windows cannot remove Microsoft.WindowsTerminal_3001.21.2911.0_neutral_~_8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed.] 
] 

2024-11-18 01:51:37.465 [CLI ] MSIX installer failed: 2147942402

Environment

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

Windows: Windows.Desktop v10.0.22621.4460
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.24.25200.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

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                        Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Enabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled