Repository navigation
Fixes from the VM test pass: HKCU elevation, standard users, Windows Update presets, Restore All - #20
Merged
Merged
Conversation
… VM tests - HKCU\Software\Policies is read-only for the user, so Bing and Notifications tweaks failed without asking for UAC. Those keys now elevate, and elevated scripts write HKCU as HKEY_USERS\<SID> so a standard user who types an administrator password changes their own hive, not the administrator's. - Create from this PC skips every power tweak when it captures the plan: they ran after the plan step and overwrote its values (a 5% minimum came back as 100%). - The high-risk warning shows only when applying a tweak, not when restoring it. - The restart notice no longer says it is shown once per session: Tweak check, interrupts and security show it for each change.
… with the Windows Update preset - A standard user who chose "Restart as administrator" got TweakHub running as the administrator account: Apply Recommended and playbooks then wrote every HKCU tweak into the administrator's profile. The single-UAC restart is now offered only to administrator accounts, where elevation keeps the same user. - Restore All restored single tweaks before the Windows Update preset. Two of them (driver updates, device metadata) share values with the preset, so the preset lost those backups and failed, leaving DeferFeatureUpdatesPeriodInDays set. The preset is now restored first.
…presets In Windows PowerShell, New-Item -Force on an existing registry key deletes the key's values and subkeys. Set-Policy called it before every value, so each preset kept only the last value in each key (Security left AUOptions, ExcludeWUDriversInQualityUpdate and DeferFeatureUpdates unset and was detected as Custom; Disabled lost NoAutoUpdate) and wiped any other Windows Update policy, WSUS settings included. The Windows AI removal script did the same to HKLM\...\Policies\Explorer. Both now create a key only when it is missing.
…session The button starts disabled and only listened for changes; the backup state is read during startup, before the page exists, so after reopening TweakHub (for example after the restart a tweak asks for) Restore All stayed grey until some tweak was toggled.
The adapter list was read once when the page opened, so an adapter connected afterwards (Ethernet plugged in while TweakHub was open) was left out.
…les Cleanup The script runs elevated: for a standard user that is the administrator's account, so GetTempPath pointed at the administrator's temp folder and the user's own was left untouched. The path now comes from TweakHub's process.
…ults match The flip tweak sets three GameDVR values to 0, which is also the Windows default, so on most PCs it showed as partly applied before ever being used, and the post-restart check reported a clean restore as Partial. A group now counts as partial only when TweakHub changed it and still keeps its backup; the network preset gets the same rule.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Fixes for the bugs found while running the pending VM tests (Windows 11 Pro 26200 Hyper-V VM, administrator account and a standard account). Every fix was retested in the VM after the change.
Bugs fixed
Windows Update presets wiped registry keys (
Scripts/WindowsUpdatePreset.ps1)Set-PolicycalledNew-Item -Forcebefore each value. In Windows PowerShell 5.1 this deletes an existing key's values and subkeys. As a result:AUOptions,ExcludeWUDriversInQualityUpdateandDeferFeatureUpdatesunset and was detected as Custom;NoAutoUpdate;The "Remove Windows AI" built-in script did the same to
HKLM\...\Policies\Explorer. Keys are now created only when missing. A new test runsSet-Policytwice on an HKCU key: before the fix onlySecondsurvived.HKCU policy tweaks failed (
RegistryService)HKCU\Software\Policiesis read-only for the user, so Remove Bing web results and Disable Notifications and Calendar always failed without asking for UAC. Those keys now elevate.Standard users: changes landed in the administrator's profile
HKEY_USERS\<SID>. Without this, a mixed HKLM+HKCU tweak run by a standard user wrote the HKCU part into the administrator's hive.Restore All
DeferFeatureUpdatesPeriodInDaysset. The preset is now restored first.Create from this PC
It added Maximum CPU performance and Core parking steps after the power plan step. Those ran on the recreated plan and overwrote the captured values: a 5% minimum came back as 100%. Power tweaks are now skipped when the plan is captured.
Smaller fixes
Tested in the VM
All passing after the fixes:
OverlayTestModeuntouched);--run-playbookelevated restart with one UAC prompt;Not tested: needs physical hardware or was skipped
bcdeditand AutoTuning checks compare English key names or enums.Build: 0 warnings. Tests: 249/249.