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.09k stars 1.44k forks source link

Attempting to install Microsoft.WindowsTerminal - Installer failed with exit code: 0x80070002 : The system cannot find the file specified. #3438

Closed dvesic closed 1 year ago

dvesic commented 1 year ago

Brief description of your issue

Attempted to install Windows Terminal over WinGet.

Fails with 0x80070002.

Steps to reproduce

Windows 11, 22H2, 22621.1848.

Both in Admin and non-admin CMD prompt:

C:\Users\dvesic>winget install --id  Microsoft.WindowsTerminal -e --verbose-logs
Found Windows Terminal [Microsoft.WindowsTerminal] Version 1.16.10261.0
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
Starting package install...
  ████████████████████████████▌   95%
Installer failed with exit code: 0x80070002 : The system cannot find the file specified.

Expected behavior

To get Windows Terminal installed.

Actual behavior

Fails with above error.

Attached verbose logs.

WinGet-2023-07-14-19-36-22.142.log

Environment

Windows Package Manager (Preview) v1.6.1573-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.1848
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.1573.0

Winget Directories                 
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
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

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
Trenly commented 1 year ago

For ease of anyone looking into this issue, here is the full error from the logs

2023-07-14 19:36:27.805 [CLI ] Installer hash verified
2023-07-14 19:36:27.805 [CORE] Started applying motw to C:\Users\dvesic\AppData\Local\Temp\WinGet\Microsoft.WindowsTerminal.1.16.10261.0\Microsoft.WindowsTerminal_Win10_1.16.10261.0_8wekyb3d8bbwe.msix with zone: 2
2023-07-14 19:36:27.813 [CORE] Finished applying motw
2023-07-14 19:36:27.970 [CORE] Starting StagePackageAsync operation #0: C:\Users\dvesic\AppData\Local\Temp\WinGet\Microsoft.WindowsTerminal.1.16.10261.0\Microsoft.WindowsTerminal_Win10_1.16.10261.0_8wekyb3d8bbwe.msix
2023-07-14 19:36:27.971 [CORE] Begin waiting for operation #0
2023-07-14 19:36:27.971 [CORE] Begin blocking for operation #0
2023-07-14 19:36:28.656 [CORE] Successfully completed #0
2023-07-14 19:36:28.656 [CORE] Starting RegisterPackageByFullNameAsync operation #1: Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe
2023-07-14 19:36:28.667 [CORE] Begin waiting for operation #1
2023-07-14 19:36:28.667 [CORE] Begin blocking for operation #1
2023-07-14 19:36:28.667 [CORE] Deployment operation #1: Windows cannot perform the RegisterByPackageFullName operation because it could not find Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe in the repository. Make sure Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe has been staged or was installed by another user.
2023-07-14 19:36:28.667 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(191)\WindowsPackageManager.dll!00007FFC1FFBB31A: (caller: 00007FFC1FEFB150) Exception(1) tid(145c) 80070002 The system cannot find the file specified.

2023-07-14 19:36:28.668 [CORE] Starting RemovePackage operation #2: Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe
2023-07-14 19:36:28.690 [CORE] Begin waiting for operation #2
2023-07-14 19:36:28.690 [CORE] Begin blocking for operation #2
2023-07-14 19:36:28.748 [CORE] Deployment operation #2: Windows cannot remove Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed.
2023-07-14 19:36:28.748 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(54)\WindowsPackageManager.dll!00007FFC1FFBA09F: (caller: 00007FFC1FFBB6FC) Exception(2) tid(145c) 80073CF1 Package was not found.

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

2023-07-14 19:36:28.749 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(126)\WindowsPackageManager.dll!00007FFC201316C1: (caller: 00007FFC1FFBCA23) LogHr(1) tid(145c) 80073CF1 Package was not found.

    Msg:[D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(54)\WindowsPackageManager.dll!00007FFC1FFBA09F: (caller: 00007FFC1FFBB6FC) Exception(2) tid(145c) 80073CF1 Package was not found.

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

@Trenly is adding dependencies to the manifests.

@dvesic After the following PR is merged and published, can you test again?

denelon commented 1 year ago

It's published.

BrandonWanHuanSheng commented 1 year ago

It was fixed.

dvesic commented 1 year ago

Confirming as fixed.