Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to enable Windows feature #3580

Closed
SpecterShell opened this issue Sep 2, 2023 · 5 comments
Closed

Failed to enable Windows feature #3580

SpecterShell opened this issue Sep 2, 2023 · 5 comments
Assignees
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@SpecterShell
Copy link
Contributor

SpecterShell commented Sep 2, 2023

Brief description of your issue

WinGet client can not enable the Windows features listed as the dependencies of the package due to the "80040154 Class not registered" error while invoking the DISM API, and hanged for about two minutes.

Probably related to #3348.

A similar bug can be found when using Get-WindowsOptionalFeature -Online in the Microsoft Store version of PowerShell 7, which is described in PowerShell/PowerShell#13866.

Steps to reproduce

  1. Add the following lines to the local installer manifest:
Dependencies:
  WindowsFeatures:
  - Microsoft-Windows-Subsystem-Linux
  1. Run winget install -m '<manifest>'

Expected behavior

The feature should be enabled successfully.

Actual behavior

The feature can not be enabled, and the output is misleading. 🫤

image

The log is as follows:

2023-09-02 20:24:00.134 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\WindowsFeature.cpp(82)\WindowsPackageManager.dll!00007FFAB3DE49AD: (caller: 00007FFAB3D4096A) LogHr(1) tid(359c) 80040154 Class not registered


2023-09-02 20:24:00.134 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\WindowsFeature.cpp(254)\WindowsPackageManager.dll!00007FFAB3DE52EF: (caller: 00007FFAB3D410E7) LogHr(2) tid(359c) C0040004 
2023-09-02 20:24:00.134 [CORE] Windows Feature [Microsoft-Windows-Subsystem-Linux] does not exist
2023-09-02 20:24:00.134 [CLI ] Terminating context: 0x8a150104 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\DependenciesFlow.cpp:de
2023-09-02 20:24:00.135 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\WindowsFeature.cpp(87)\WindowsPackageManager.dll!00007FFAB3D433A2: (caller: 00007FFAB3D40F6D) LogHr(3) tid(359c) C0040004 

The portable version of the WinGet client works properly:

image

image

Environment

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

Windows: Windows.Desktop v10.0.22621.2215
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.2291.0
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Sep 2, 2023
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Sep 5, 2023
@denelon
Copy link
Contributor

denelon commented Sep 5, 2023

"Virtual Machine Platform" is the feature used by WSL and it's called out in:

We still need to get the WinGet 1.6 client out with dependency support and update validation to properly use the features. Then we will be able to submit a WSL manifest with a dependency on the "Virtual Machine Platform".

@SpecterShell
Copy link
Contributor Author

I don't think this is related to the feature to be enabled. It is also the same for NetFx3.

2023-09-02 19:23:38.857 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\WindowsFeature.cpp(82)\WindowsPackageManager.dll!00007FFAB0A949AD: (caller: 00007FFAB09F096A) LogHr(1) tid(61a4) 80040154 Class not registered


2023-09-02 19:23:38.858 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\WindowsFeature.cpp(254)\WindowsPackageManager.dll!00007FFAB0A952EF: (caller: 00007FFAB09F10E7) LogHr(2) tid(61a4) C0040004 
2023-09-02 19:23:38.858 [CORE] Windows Feature [netfx3] does not exist
2023-09-02 19:23:38.859 [CLI ] Terminating context: 0x8a150104 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\DependenciesFlow.cpp:de
2023-09-02 19:23:38.859 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\WindowsFeature.cpp(87)\WindowsPackageManager.dll!00007FFAB09F33A2: (caller: 00007FFAB09F0F6D) LogHr(3) tid(61a4) C0040004 

@denelon
Copy link
Contributor

denelon commented Sep 8, 2023

@ryfu-msft maybe we should consider an enumeration of the available Windows Features.

I'm expecting we will need to document this as well in the documentation for the manifest schema as a part of the 1.6 release update.

@ryfu-msft ryfu-msft self-assigned this Sep 12, 2023
@ryfu-msft
Copy link
Contributor

@SpecterShell,

We've decided to move this feature back to being experimental :(

There is an issue with enabling the windows feature in packaged context, which is why it is throwing a COM exception (Class not registered). Since we are preparing to officially release a stable version of v1.6 soon, this will need to be addressed in v1.7.

@ryfu-msft ryfu-msft added this to the v1.7 Client milestone Sep 14, 2023
@denelon denelon modified the milestones: v1.7 Client, 1.8 Client Jan 4, 2024
@denelon
Copy link
Contributor

denelon commented Mar 6, 2024

We've updated this in WinGet 1.7. Windows Features are now supported as a package dependency.

@denelon denelon closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

3 participants