Repository navigation
[release/v7.6.10] Use GetCurrentPackageFamilyNameNative API instead of path matching to detect MSIX installation - #28313
Open
Dongbo Wang (daxian-dbw) wants to merge 1 commit into
Conversation
…to detect MSIX installation (PowerShell#28029)
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The Windows startup PATH backport lacks release-branch validation of MSIX execution-alias resolution, unpackaged startup, and unavailable-native-API fallback; documented upstream testing does not establish those runtime results.
No open issues 🎉
What changed in this PR
Backports #28029 to release/v7.6.10, refining the existing MSIX startup PATH fix by detecting package identity through a Windows API rather than installation-path matching.
Changes:
- Adds native package-family lookup with cached installation detection.
- Uses the package family name to select the stable execution-alias directory for PATH.
- Makes Windows executable-name comparisons case-insensitive while preserving Unix behavior.
| File | Description |
|---|---|
src/System.Management.Automation/engine/Utils.cs |
Caches MSIX identity detection and the package family name. |
src/System.Management.Automation/engine/Interop/Windows/GetCurrentPackageFamilyName.cs |
Adds a native package-family lookup wrapper. |
src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs |
Replaces path-based detection and handles mixed-case Windows executable names. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #28029 to release/v7.6.10
Triggered by Dongbo Wang (@daxian-dbw) on behalf of Dongbo Wang (@daxian-dbw)
Original CL Label: CL-General
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
Customer Impact
Improves handling of the customer-reported MSIX/PATH issue discussed in #27782. Uses native package identity detection instead of installation-path matching to select the stable execution-alias directory, and compares Windows process names case-insensitively so mixed-case launch paths are handled correctly.
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
The original PR reports validation with the MSIX bundle produced by its build. Backport commit ce96a4c cherry-picked without conflicts and the working tree is clean. Local tests were not run; backport CI must pass before merge.
Risk
REQUIRED: Check exactly one box.
Changes startup PATH handling and adds Windows native interop. Changes are scoped to installation detection and Windows process-name comparison; the prerequisite MSIX PATH fix is already backported.