Repository navigation
Restore WaaSMedicSvc and clear SYSTEM deny rules in Restore Defaults - #5233
Conversation
Restore Defaults stopped touching WaaSMedicSvc when its Set-Service call was removed, because the launch protected service denies that call. A machine where another tweak tool disabled the service therefore stayed disabled, and Set-Service can also fail on update service keys where such a tool denied SYSTEM write access. Remove SYSTEM deny rules from the update service keys before restoring startup types, and set WaaSMedicSvc back to Manual through its registry start value. Failures are logged as warnings and the workflow continues.
Note that Windows Default removes SYSTEM deny rules from update service registry keys and sets WaaSMedicSvc back to Manual.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Type of Change
Description
Restore Defaults on the Updates tab (
Invoke-WPFUpdatesdefault) no longer restoresWaaSMedicSvc, so a machine where another tweak tool disabled that service stays disabled. ItsSet-Servicecall was removed in #4845, and #4267 and #5095 show that call is denied because the service is launch protected. In #4309 the intent was stated that Restore Defaults should give the best shot at recovering from other tools, and #5096 already restores this service through its registry value on the Win11 Creator path.Some tools also add a deny rule for
SYSTEMon the update service registry keys to stop Windows from re-enabling them.Set-Servicegoes through the Service Control Manager, which runs asSYSTEM, so I expect it to fail on those keys until the rule is gone.Changes
SYSTEMdeny rules from theBITS,wuauserv,UsoSvcandWaaSMedicSvcservice keys before restoring startup types. Rules for other accounts are left alone, and the ACL is only written when aSYSTEMdeny rule exists. Rules are matched by SID (S-1-5-18) because the account name is localized on some Windows languages.WaaSMedicSvcback to Manual through itsStartregistry value, skipping the write when it is already3.Set-Serviceis still not called for this service.Disable Updates is unchanged and does not touch
WaaSMedicSvc.Testing
pester/update-profiles.Tests.ps1: 23 of 23 pass. 5 of the 7 new tests fail against the old function; the other 2 assert that nothing is changed..\Compile.ps1passes andwinutil.ps1is not included in this PR.The repair paths were exercised on a disposable hosted Windows runner, including real service-key writes and restoration of the original state; details are recorded below. Hardened consumer service ACLs remain unverified. Protected operations remain best-effort and produce warnings if Windows denies access.
Issue related to PR
Review validation
Validated head:
09247f534500346c3176d78c3f91628a8673a65d.Compile passed. Pester 5.8.0: 1,048 passed, 0 failed, 1 expected skip because the compiled headless test would open UAC. PSScriptAnalyzer 1.20.0: zero Error diagnostics; convention warnings remain. Direct built-in Codex review: no actionable findings.
Disposable Windows runner capability test passed all 13 real registry/DACL/SCM operations, including WaaSMedicSvc Start=4 to Start=3. Original Start values and SDDL were restored for BITS, wuauserv, UsoSvc, and WaaSMedicSvc. Real temporary registry keys confirmed explicit SYSTEM deny removal, inherited-deny preservation, and preservation of unrelated rules.
The runner used Windows build 26100 and SYSTEM-owned service keys. This does not establish access on every hardened consumer installation; the guide describes best-effort repair and warnings for protected keys. No workstation service or registry settings were changed during validation.
Additional compatibility snapshot with feat(install): bundle app icons and speed up the app list #5199, feat: queue actions while a job is running, with reorder and cancel #5207, and feat(ui): add working view to Install and Tweaks tabs #5147: compile passed; 1,147 Pester tests passed, 0 failed, 1 expected UAC skip; analyzer reported zero Errors; native WPF FIFO handoff passed. The snapshot was temporary and was not committed.
Compile-and-Check passed after this head was pushed.
Final-head Unit Tests CI passed on commit
09247f534500346c3176d78c3f91628a8673a65d: 1049 Pester tests passed, zero failures/skips, and PSScriptAnalyzer passed. The existing workflow ran against that exact commit on a temporary validation branch because the contributor fork had no full test run. Hosted CodeRabbit approved this head; the final independent Sol skeptic review found no actionable concerns. No unresolved review threads remain.