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

Can't install package after cancelling installation with CTRL+C #3913

Closed mundodisco8 closed 10 months ago

mundodisco8 commented 10 months ago

Brief description of your issue

I was installing a package (Windows Terminal Preview) and had second thoughts, so I cancelled with ctrl + c at some point during the installation

$ winget install Microsoft.WindowsTerminal.Preview

Found Windows Terminal Preview [Microsoft.WindowsTerminal.Preview] Version 1.19.2831.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.
This package requires the following dependencies:
  - Packages
      Microsoft.UI.Xaml.2.8 [>= 2.8.4]
(1/1) Found Microsoft.UI.Xaml [Microsoft.UI.Xaml.2.8] Version 8.2306.22001.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.
Downloading https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.5/Microsoft.UI.Xaml.2.8.x64.appx
  ██████████████████████████████  4.88 MB / 4.88 MB
Successfully verified installer hash
Starting package install...
  ██████████████████████████████  100%
Successfully installed

Successfully verified installer hash
Starting package install...
  ▌                               2%
An unexpected error occurred while executing the command:
0x800704c7 : unknown error

I then decided to install it, after doing some unrelated stuff that I wanted to do before installing it, but now winget says that I have it already installed

winget install Microsoft.WindowsTerminal.Preview

Found Windows Terminal Preview [Microsoft.WindowsTerminal.Preview] Version 1.19.2831.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.
This package requires the following dependencies:
  - Packages
      Microsoft.UI.Xaml.2.8 [>= 2.8.4]
(1/1) Found Microsoft.UI.Xaml [Microsoft.UI.Xaml.2.8] Version 8.2306.22001.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%
A higher version of this application is already installed.
Installer failed with exit code: 0x80073d06 : unknown error

I tried with some options

winget install Microsoft.WindowsTerminal.Preview --uninstall-previous --verbose-logs --force --version 1.19.2831.0

But the output is the same. Windows terminal doesn't appear as installed

winget remove Microsoft.WindowsTerminal.Preview

No installed package found matching input criteria.

winget list Microsoft.WindowsTerminal.Preview

No installed package found matching input criteria.

I can see a wt.exe file in my computer, but it's for an older version (1.16, current is 1.19)

Steps to reproduce

Install a package Cancel it at the later stages by pressing control + c Reinstall the package

Expected behavior

The package installation is interrupted and Winget cleans its status

Actual behavior

Winget gets confused and marks the program as installed

Environment

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

Windows: Windows.Desktop v10.0.22621.2715
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.3172.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           Disabled
denelon commented 10 months ago

The install may have already started when the [ctrl]+[c] was submitted. You may need to try to install again with "--force".

mundodisco8 commented 10 months ago

Hey Denelon, thanks for the help.

Yeah, I tried that already

 winget install Microsoft.WindowsTerminal.Preview --force

Found Windows Terminal Preview [Microsoft.WindowsTerminal.Preview] Version 1.19.2831.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.
This package requires the following dependencies:
  - Packages
      Microsoft.UI.Xaml.2.8 [>= 2.8.4]
(1/1) Found Microsoft.UI.Xaml [Microsoft.UI.Xaml.2.8] Version 8.2306.22001.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%
A higher version of this application is already installed.
Installer failed with exit code: 0x80073d06 : unknown error

And specifying the version

winget install Microsoft.WindowsTerminal.Preview --force --version 1.19.2831.0

Found Windows Terminal Preview [Microsoft.WindowsTerminal.Preview] Version 1.19.2831.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.
This package requires the following dependencies:
  - Packages
      Microsoft.UI.Xaml.2.8 [>= 2.8.4]
(1/1) Found Microsoft.UI.Xaml [Microsoft.UI.Xaml.2.8] Version 8.2306.22001.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%
A higher version of this application is already installed.
Installer failed with exit code: 0x80073d06 : unknown error

And even installing a previous version and upgrading

winget install Microsoft.WindowsTerminal.Preview --force --version 1.17.10234.0 --uninstall-previous

Found Windows Terminal Preview [Microsoft.WindowsTerminal.Preview] Version 1.17.10234.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.
Downloading https://github.com/microsoft/terminal/releases/download/v1.17.1023/Microsoft.WindowsTerminalPreview_Win10_1.17.10234.0_8wekyb3d8bbwe.msixbundle
  38.5 MB / 38.5 MB
Successfully verified installer hash
Starting package install...
  100%
Successfully installed

winget list Microsoft.WindowsTerminal.Preview

Name                     Id                                Version      Available   Source
------------------------------------------------------------------------------------------
Windows Terminal Preview Microsoft.WindowsTerminal.Preview 1.17.10234.0 1.19.2831.0 winget

winget upgrade Microsoft.WindowsTerminal.Preview

Found Windows Terminal Preview [Microsoft.WindowsTerminal.Preview] Version 1.19.2831.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.
This package requires the following dependencies:
  - Packages
      Microsoft.UI.Xaml.2.8 [>= 2.8.4]
(1/1) Found Microsoft.UI.Xaml [Microsoft.UI.Xaml.2.8] Version 8.2306.22001.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%
A higher version of this application is already installed.
Installer failed with exit code: 0x80073d06 : unknown error

Is there a database I can reset, reconstruct or straightaway delete? Otherwise it seems the best course of action seems to be waiting for the next release

Trenly commented 10 months ago

@munodisco - It seems the issue may actually be with the Microsoft.UI.Xaml package dependency. Have you tried with --skip-dependencies ?

mundodisco8 commented 10 months ago

YES! That worked. Thanks!

Something remains broken, because if I uninstall it and reinstall it, the error reappears, and I can't seem to find a way to uninstall the Windows UI library component, but I can install with --skip-dependencies

I'll close this

martinlb commented 10 months ago

Hello! I had the same issue (without ctrl + c cancelation) and skipping depedencies installation solved it.