winget-cli: upgrade of WindowsTerminal fails with 0x80070002 (System cant find the file specified)

Brief description of your issue

Trying to upgrade WindowsTerminal fails:

<my PS prompt:> winget upgrade Microsoft.WindowsTerminal
Gefunden Windows Terminal [Microsoft.WindowsTerminal] Version 1.11.2921.0
Diese Anwendung wird von ihrem Besitzer an Sie lizenziert.
Microsoft ist nicht verantwortlich und erteilt keine Lizenzen für Pakete von Drittanbietern.
Der Installer-Hash wurde erfolgreich überprüft
Paketinstallation wird gestartet...
Installieren fehlgeschlagen mit Exitcode: 0x80070002 : The system cannot find the file specified

Steps to reproduce

  • open a PSHell windows
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.19041.1237
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1237
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
  • run winget upgrade Microsoft.WindowsTerminal
  • see it fail

Expected behavior

winget should be able to upgrade WindowsTerminal

Actual behavior

winget fails to upgrade WindowsTerminal

Environment

> winget --info
Windows Package Manager v1.1.12653
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.

Windows: Windows.Desktop v10.0.19042.1288
Paket: Microsoft.DesktopAppInstaller v1.16.12653.0

Protokolle: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

Links
-----------------------------------------------------------------------------------------
Datenschutzerklärung              https://aka.ms/winget-privacy
Lizenzvereinbarung                https://aka.ms/winget-license
Hinweise von Drittanbietern       https://aka.ms/winget-3rdPartyNotice
Startseite                        https://aka.ms/winget
Windows Store Nutzungsbedingungen https://www.microsoft.com/en-us/storedocs/terms-of-sale

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 8
  • Comments: 29 (4 by maintainers)

Most upvoted comments

try winget update --id Microsoft.WindowsTerminal --skip-dependencies

Same issue on multiple Windows 10 PCs when installing or upgrading Terminal. Gets stuck when installing the UI.Xaml.2.8 dep at 95%… every time.

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

Doesn’t occur in Sandbox. Very frustrating

EDIT: the version of UI.Xaml.2.8 that is already installed is as follows: Microsoft.UI.Xaml.2.8_8.2310.30001.0_x64__8wekyb3d8bbwe.PackageFullName

The Terminal install doesn’t seem to be able to install over this or see it as an already fulfilled dependency.

I was getting 0x80070002 at the CLI. However, in the event log Microsoft\Windows\AppXDeployment-Server, I saw failures with code 0x80073CF1 ERROR_INSTALL_PACKAGE_NOT_FOUND - “You may get this error while removing a package that isn’t installed for the current user” (look up error codes at Troubleshooting packaging, deployment, and query of Windows apps)

I originally installed Terminal from the MS Store.

Get-AppxLog showed that install and uninstall operations were trying to delete Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe - note the _3001 - and failing “because the current user does not have that package installed”:

Started deployment Remove operation on a package with main parameter Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe and Options 0 and 0. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
Creating Resiliency File C:\ProgramData\Microsoft\Windows\AppRepository\d9ebce5f-b486-4d36-943d-cc02bfc1012e_S-1-5-21-46638544-3861203688-939887306-1001_4.rslc for Remove Operation on Package Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe.
Deployment Remove operation on package Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe has been de-queued and is running for user SID S-1-5-21-46638544-3861203688-939887306-1001.
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.
The last successful state reached was BundleProcessed. Failure occurred before reaching the next state Indexed. hr: 0x80073CF1
Deployment Remove operation with target volume C: on Package Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe from:   failed with error 0x80073CF1. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
AppX Deployment operation failed for package Microsoft.WindowsTerminal_3001.16.10261.0_neutral_~_8wekyb3d8bbwe with error 0x80073CF1. The specific error text for this failure is: 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.

I could not see the _3001 package with Get-AppxPackage -AllUsers, only the non-3001 package. What worked was:

Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsTerminal_3001.16.10262.0_neutral_~_8wekyb3d8bbwe

After that, winget install Microsoft.WindowsTerminal worked fine (as non-admin).

Deleting folders from C:\Program Files\WindowsApps ultimately had no effect, although at one point I did bang my head on a folder in C:\Program Files\WindowsApps\Deleted which was referred to in the logs (Microsoft.WindowsAppRuntime.1.2_2000.747.1945.0_x64__8wekyb3d8bbwe6356ff11-e47c-4092-a5df-bf835d1460a5 FWIW.)

@denelon I tried to install on Windows 11 (22621.1265), with Winget version v1.4.10173, but result in the same error. The command that I used was winget install --id Microsoft.WindowsTerminal -e, but trying with winget install "windows terminal" --source "msstore" did work.

We noticed Windows Terminal had a pair of releases fairly close together. One targets Windows 10 and the other targets Windows 11. The Windows 11 version was higher so users on Windows 10 were not able to install. We need to add minimum OS requirements for search to show the latest version available for an OS rather than just the “latest version”.

Is anyone encountering this error on Windows 10?

I noticed this between 1.12 and 1.13.

https://github.com/microsoft/winget-pkgs/blob/20f4efcb2af5c64571a8ca976af64382144aaac8/manifests/m/Microsoft/WindowsTerminal/1.12.10983.0/Microsoft.WindowsTerminal.installer.yaml#L8

https://github.com/microsoft/winget-pkgs/blob/20f4efcb2af5c64571a8ca976af64382144aaac8/manifests/m/Microsoft/WindowsTerminal/1.13.11431.0/Microsoft.WindowsTerminal.installer.yaml#L17

If anyone runs into this problem just trying to install Windows Terminal, you can use the Microsoft Store source instead:

winget install "windows terminal" --source "msstore"