Fix per-package architecture detection for windows/app packages#6875
Merged
Fix per-package architecture detection for windows/app packages#6875
Conversation
Previously all windows/app packages used platform.Arch (e.g. AMD64) regardless of whether they were 32-bit or 64-bit. This caused duplicate package scores when both x86 and x64 variants of the same package (e.g. Microsoft .NET Runtime) were installed. Two-tier detection: 1. Primary: Wow6432Node in the registry path (authoritative for HKLM, which is redirected by WOW64) 2. Fallback: "Program Files (x86)" in InstallLocation/UninstallString (covers HKCU where HKCU\SOFTWARE is a shared, non-redirected key) Applied to all three code paths: local registry, filesystem/device, and PowerShell remote (via PSPath property added to Select-Object output). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
/review |
Contributor
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
windows/apppackages usedplatform.Arch(e.g.AMD64) regardless of whether they were 32-bit or 64-bit, causing duplicate package scores when both x86 and x64 variants (e.g.Microsoft .NET Runtime - 8.0.7 (x86)and(x64)) were installed on the same systemWow6432Nodein registry path — authoritative for HKLM, which is redirected by WOW64Program Files (x86)inInstallLocation/UninstallString— covers HKCU whereHKCU\SOFTWAREis a shared, non-redirected keyPSPathproperty added toSelect-Objectoutput)windows/appxpackages are not affected — they already report per-package architecture via theArchitecturefield fromGet-AppxPackageorAppxManifest.xmlTest plan
archForRegistryPath(all path variants: HKLM, HKCU, PSPath, filesystem)archFromInstallPath(Program Files x86 detection, edge cases)ParseWindowsAppPackageswith PSPath (Wow6432Node vs native)ParseWindowsAppPackageswith install path fallback (HKCU entries)getPackageFromRegistryKeyItemswith Wow6432Node-determined arch is not overridden🤖 Generated with Claude Code