Skip to content

Add error when using dism resources via Appx#1479

Merged
SteveL-MSFT merged 1 commit intoPowerShell:mainfrom
SteveL-MSFT:dism-appx
Apr 11, 2026
Merged

Add error when using dism resources via Appx#1479
SteveL-MSFT merged 1 commit intoPowerShell:mainfrom
SteveL-MSFT:dism-appx

Conversation

@SteveL-MSFT
Copy link
Copy Markdown
Member

PR Summary

There is a known issue with Appx that prevents access to dism APIs. So if the error returned indicates the class is not registered, tell the user it is not supported.

@SteveL-MSFT SteveL-MSFT added this to the 3.2-Consider milestone Apr 11, 2026
Copilot AI review requested due to automatic review settings April 11, 2026 04:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a targeted, user-friendly error for a known limitation where DISM APIs aren’t accessible when the resource is installed via Appx, surfacing a clearer failure mode during session initialization.

Changes:

  • Detect REGDB_E_CLASSNOTREG from DismInitialize and DismOpenSession and return a dedicated localized error.
  • Add a new dism.notSupportedAppx localized string for the new error path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
resources/dism_dsc/src/dism.rs Adds HRESULT check for REGDB_E_CLASSNOTREG during DISM initialization/session open and returns a localized “not supported via Appx” error.
resources/dism_dsc/locales/en-us.toml Adds the notSupportedAppx message used by the new error path.

@SteveL-MSFT SteveL-MSFT merged commit 4d84481 into PowerShell:main Apr 11, 2026
23 checks passed
@SteveL-MSFT SteveL-MSFT deleted the dism-appx branch April 11, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants