Skip to content

Fix 7 bugs across 5 files: HKCU propagation, uninstall warning, EKU … - #1693

Closed
Mohammad-Faiz-Cloud-Engineer wants to merge 1 commit into
Atlas-OS:mainfrom
Mohammad-Faiz-Cloud-Engineer:main
Closed

Fix 7 bugs across 5 files: HKCU propagation, uninstall warning, EKU …#1693
Mohammad-Faiz-Cloud-Engineer wants to merge 1 commit into
Atlas-OS:mainfrom
Mohammad-Faiz-Cloud-Engineer:main

Conversation

@Mohammad-Faiz-Cloud-Engineer

Copy link
Copy Markdown

…validation, taskbar cleanup, ARM64 detection

TECHNICAL EXPLANATION

  1. APPLYDUHIVE.ps1:16 - HKCU default user propagation (Critical)

    • Bug: -like 'HKCU' performs exact string match
    • Fix: Changed to -like 'HKCU*' so all HKCU paths are correctly matched
    • Impact: Previously 0% of HKCU registry tweaks were inherited by new users
  2. packageInstall.ps1:181-182 - Wrong variable in uninstall warning (Medium)

    • Bug: Used $notMatchedPackages (undefined at that point) instead of $notInstalledPackages (defined on line 166)
    • Fix: Changed both references to $notInstalledPackages
    • Impact: Warning about unmatched uninstall packages was silently suppressed
  3. packageInstall.ps1:300 - EKU certificate validation (Medium)

    • Bug: -ne on array returns non-matching elements; certs with multiple EKUs were incorrectly rejected
    • Fix: Changed to -notcontains which correctly tests collection membership
    • Impact: Valid multi-EKU certificates no longer falsely rejected
  4. taskbarPins.ps1:108-114 - Dead code and error on missing path (Low)

    • Bug: Test-Path -PathType Leaf checks if path is a FILE; TaskBar is a DIRECTORY
    • Fix: Replaced with simple Test-Path + Remove-Item wildcard
    • Impact: No more cosmetic red errors when TaskBar dir doesn't exist

5-7. packageInstall.ps1:29, SOFTWARE.ps1:16, CLIENTCBS.ps1:12 - ARM64 detection (Low)

  • Bug: 32-bit PowerShell on ARM64 sees PROCESSOR_ARCHITECTURE=x86, not ARM64
  • Fix: Added PROCESSOR_ARCHITEW6432 fallback
  • Impact: ARM64 correctly detected in WOW64 processes when CIM query fails

PLAIN ENGLISH EXPLANATION

  1. NEW USERS WERE MISSING YOUR SETTINGS - The script that copies your personalization tweaks to new user accounts had a typo. It was looking for an exact match when it should have been looking for anything starting with 'HKCU'. This meant none of your settings were ever applied to new users. Every new person had to start from scratch. Now it works.

  2. A WARNING THAT COULDN'T SPEAK - When the installer couldn't find a Windows component to remove, it was supposed to warn you. But it referenced the wrong variable name, so the warning was silently swallowed. You'd never know something failed. Now it tells you.

  3. VALID CERTIFICATES WERE BEING REJECTED - The code that verifies component-removal packages checked incorrectly. If a certificate had multiple purposes listed, it would wrongly reject it even if the correct purpose was there. Now it correctly accepts valid certs.

  4. TASKBAR CLEANER WAS LOOKING IN THE WRONG PLACE - When pinning browser shortcuts, the old code checked 'is this a file?' when the taskbar is actually a folder. This never worked, so it always fell through to a backup method that would throw scary red errors if the taskbar folder didn't exist. Now it just checks 'does this exist?' and cleans up properly.

5-7. ARM64 CHIP DETECTION WAS INCOMPLETE - Three places in the code try to detect ARM64 processors. On some systems where PowerShell runs in compatibility mode, the architecture wasn't being detected at all. Added a fallback check so ARM64 systems are always correctly identified.

…validation, taskbar cleanup, ARM64 detection

TECHNICAL EXPLANATION
---------------------

1. APPLYDUHIVE.ps1:16 - HKCU default user propagation (Critical)
   - Bug: -like 'HKCU' performs exact string match
   - Fix: Changed to -like 'HKCU*' so all HKCU paths are correctly matched
   - Impact: Previously 0% of HKCU registry tweaks were inherited by new users

2. packageInstall.ps1:181-182 - Wrong variable in uninstall warning (Medium)
   - Bug: Used $notMatchedPackages (undefined at that point) instead of $notInstalledPackages (defined on line 166)
   - Fix: Changed both references to $notInstalledPackages
   - Impact: Warning about unmatched uninstall packages was silently suppressed

3. packageInstall.ps1:300 - EKU certificate validation (Medium)
   - Bug: -ne on array returns non-matching elements; certs with multiple EKUs were incorrectly rejected
   - Fix: Changed to -notcontains which correctly tests collection membership
   - Impact: Valid multi-EKU certificates no longer falsely rejected

4. taskbarPins.ps1:108-114 - Dead code and error on missing path (Low)
   - Bug: Test-Path -PathType Leaf checks if path is a FILE; TaskBar is a DIRECTORY
   - Fix: Replaced with simple Test-Path + Remove-Item wildcard
   - Impact: No more cosmetic red errors when TaskBar dir doesn't exist

5-7. packageInstall.ps1:29, SOFTWARE.ps1:16, CLIENTCBS.ps1:12 - ARM64 detection (Low)
   - Bug: 32-bit PowerShell on ARM64 sees PROCESSOR_ARCHITECTURE=x86, not ARM64
   - Fix: Added PROCESSOR_ARCHITEW6432 fallback
   - Impact: ARM64 correctly detected in WOW64 processes when CIM query fails

PLAIN ENGLISH EXPLANATION
-------------------------

1. NEW USERS WERE MISSING YOUR SETTINGS - The script that copies your personalization tweaks to new user accounts had a typo. It was looking for an exact match when it should have been looking for anything starting with 'HKCU'. This meant none of your settings were ever applied to new users. Every new person had to start from scratch. Now it works.

2. A WARNING THAT COULDN'T SPEAK - When the installer couldn't find a Windows component to remove, it was supposed to warn you. But it referenced the wrong variable name, so the warning was silently swallowed. You'd never know something failed. Now it tells you.

3. VALID CERTIFICATES WERE BEING REJECTED - The code that verifies component-removal packages checked incorrectly. If a certificate had multiple purposes listed, it would wrongly reject it even if the correct purpose was there. Now it correctly accepts valid certs.

4. TASKBAR CLEANER WAS LOOKING IN THE WRONG PLACE - When pinning browser shortcuts, the old code checked 'is this a file?' when the taskbar is actually a folder. This never worked, so it always fell through to a backup method that would throw scary red errors if the taskbar folder didn't exist. Now it just checks 'does this exist?' and cleans up properly.

5-7. ARM64 CHIP DETECTION WAS INCOMPLETE - Three places in the code try to detect ARM64 processors. On some systems where PowerShell runs in compatibility mode, the architecture wasn't being detected at all. Added a fallback check so ARM64 systems are always correctly identified.

@TheyCreeper TheyCreeper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@RadNotRed
RadNotRed self-requested a review August 1, 2026 16:46

@RadNotRed RadNotRed left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Plz make pr for new-update branch instead

@Mohammad-Faiz-Cloud-Engineer Mohammad-Faiz-Cloud-Engineer closed this by deleting the head repository Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

playbook Playbook related issues/PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants