Skip to content

Conversation

@ZeusCraft10
Copy link
Contributor

@ZeusCraft10 ZeusCraft10 commented Jan 28, 2026

Summary

Fixes the issue where "Get Installed" in the Tweaks tab was not correctly pulling all toggle states (#3762), plus several additional config bugs discovered during investigation.

Changes

1. Unified Toggle Detection Logic (Issue #3762)

  • Invoke-WinUtilCurrentSystem now uses Get-WinUtilToggleStatus for Type: "Toggle" tweaks
  • This ensures "Get Installed" uses the same logic as UI initialization, eliminating inconsistencies

2. Fixed Registry Value Detection

  • Critical Bug Fix: Changed null checks from if(!$regstate) to if($null -eq $regstate) in both:
    • functions/private/Invoke-WinUtilCurrentSystem.ps1
    • functions/private/Get-WinUtilToggleStatus.ps1
  • Previously, registry values of 0 were incorrectly treated as missing because 0 is falsy in PowerShell
  • Now correctly distinguishes between missing keys and legitimate 0 values

3. Added DefaultState Support

  • Registry detection now properly handles DefaultState for tweaks with missing registry keys
  • Matches the behavior already present in Get-WinUtilToggleStatus

4. Non-Detectable Tweaks Handling

  • Added debug logging for tweaks with only InvokeScript or appx entries
  • These tweaks are skipped (as there's no deterministic way to detect their state)

5. Fixed WPFTweaksUTC Registry Type

  • Changed RealTimeIsUniversal registry type from QWord to DWord
  • This is a standard Windows 32-bit integer; wrong type would cause registry operation to fail

6. Fixed Duplicate Order Collision (First Instance)

  • Changed WPFTweaksRemoveGallery order from "a029_" back to "a030_"
  • Three tweaks had the same order value causing unpredictable UI sorting

7. Fixed FFmpeg Display Name

  • Changed ffmpeg content from "eibol.FFmpegBatchAVConverter" (package ID) to "FFmpeg Batch AV Converter" (user-friendly name)

8. Fixed WPFTweaksServices Service Startup Types

  • Changed TermService (Remote Desktop) from Automatic to Manual
  • Changed VaultSvc (Credential Manager) from Automatic to Manual
  • Now consistent with tweak's stated purpose of setting services to Manual

9. Fixed OneDrive Removal Script

  • Removed Stop-Process -Name Explorer which killed Explorer before cleanup operations
  • Replaced with Stop-Process -Name FileCoAuth only, with -ErrorAction SilentlyContinue
  • Added Start-Process explorer.exe to restart Explorer after cleanup
  • Fixed permissions: replaced incorrect /grant "Administrators:(D,DC)" with proper /reset and /grant "Administrators:(F)"
  • Added -ErrorAction SilentlyContinue to file removal operations for robustness

10. Fixed Duplicate Order Collision (Second Instance)

  • Changed WPFTweaksRemoveHome order from "a029_" to "a029a_"
  • Resolves conflict with WPFTweaksRemoveOneDrive

11. Fixed Copilot Removal Script

  • Added wildcard pattern: Get-AppxPackage *MicrosoftWindows.Client.CoreAI* instead of exact match
  • Added null check: wrapped removal operations in if ($Appx) block
  • Prevents failures when package name varies by Windows version

Files Changed

  • functions/private/Invoke-WinUtilCurrentSystem.ps1 - Toggle detection logic
  • functions/private/Get-WinUtilToggleStatus.ps1 - Null check fix
  • config/tweaks.json - Registry types, order fixes, service types, script fixes
  • config/applications.json - FFmpeg display name fix

Testing

Manual Verification Steps:

  1. Open Tweaks tab and note initial toggle states (especially those with DefaultState)
  2. Click "Get Installed"
  3. Verify toggle states remain consistent and accurate
  4. Test with tweaks that have registry values of 0 (e.g., dark mode toggles)
  5. Verify WPFTweaksUTC dual-boot time setting works correctly
  6. Verify RemoveOneDrive, RemoveHome, RemoveGallery appear in correct order
  7. Test OneDrive removal doesn't break Explorer or leave permissions in broken state
  8. Test Copilot removal works across different Windows versions

Impact

  • ✅ Fixes toggle state detection inconsistency
  • ✅ Resolves issue with 0 values being treated as missing
  • ✅ Makes "Get Installed" behavior match UI initialization
  • ✅ Fixes dual-boot UTC time setting
  • ✅ Fixes UI ordering for advanced tweaks
  • ✅ Improves UX with proper app display names
  • ✅ Prevents Remote Desktop and Credential Manager from auto-starting
  • ✅ Makes OneDrive removal more reliable and doesn't break Explorer
  • ✅ Makes Copilot removal work reliably across Windows versions
  • ✅ No breaking changes - purely additive/corrective logic

Closes #3762

@ZeusCraft10 ZeusCraft10 marked this pull request as ready for review January 28, 2026 21:36
@ChrisTitusTech ChrisTitusTech added the bug Something isn't working label Jan 28, 2026
@GabiNun
Copy link
Contributor

GabiNun commented Jan 29, 2026

it would look alot better if you put spaces after the if statment example
before

if($registryTotal -gt 0 -and $registryMatchCount -ne $registryTotal) {
     $values += $False
}

after

if ($registryTotal -gt 0 -and $registryMatchCount -ne $registryTotal) {
     $values += $False
}

@ZeusCraft10 ZeusCraft10 force-pushed the fix/issue-3762-get-installed-toggles-clean branch 2 times, most recently from fa24c22 to 031b810 Compare January 29, 2026 19:48
Fixes the issue where "Get Installed" in the Tweaks tab was not correctly
pulling all toggle states, plus several additional config bugs discovered
during investigation.

Changes:
- Unified toggle detection logic using Get-WinUtilToggleStatus
- Fixed registry value detection (0 values were incorrectly treated as missing)
- Added DefaultState support for missing registry keys
- Fixed WPFTweaksUTC registry type (QWord → DWord)
- Fixed WPFTweaksServices startup types (TermService, VaultSvc: Automatic → Manual)
- Fixed duplicate order collisions in tweaks
- Fixed FFmpeg display name
- Improved OneDrive removal script reliability
- Improved Copilot removal script with wildcard pattern and null check
- Fixed code formatting (added spaces after if/Foreach statements)

Files changed:
- functions/private/Invoke-WinUtilCurrentSystem.ps1
- functions/private/Get-WinUtilToggleStatus.ps1
- config/tweaks.json
- config/applications.json

Fixes ChrisTitusTech#3762
Fixes ChrisTitusTech#3189
Fixes ChrisTitusTech#3876
Potentially fixes ChrisTitusTech#3008
Potentially fixes ChrisTitusTech#3815
@ZeusCraft10 ZeusCraft10 force-pushed the fix/issue-3762-get-installed-toggles-clean branch from 07d748e to ca492e6 Compare January 29, 2026 20:13
@GabiNun
Copy link
Contributor

GabiNun commented Feb 5, 2026

11. Fixed Copilot Removal Script
Added wildcard pattern: Get-AppxPackage *MicrosoftWindows.Client.CoreAI* instead of exact match

no reason to do this its useless might as well make it *ai* than

9. Fixed OneDrive Removal Script
Removed Stop-Process -Name Explorer which killed Explorer before cleanup operations

we need to stop explorer to delete those files

9. Fixed OneDrive Removal Script
Fixed permissions: replaced incorrect /grant "Administrators:(D,DC)" with proper /reset and /grant "Administrators:(F)"

no need for /reset we dont need it

and we dont need -ErrorAction SilentlyContinue since we wont see the error anyway

Copy link
Owner

@ChrisTitusTech ChrisTitusTech left a comment

Choose a reason for hiding this comment

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

Great job, cleaned up a few changes and its good to merge

@ChrisTitusTech ChrisTitusTech merged commit 414cd13 into ChrisTitusTech:main Feb 10, 2026
2 checks passed
@ChrisTitusTech ChrisTitusTech mentioned this pull request Feb 10, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get Installed isn't pulling all tweaks, check toggles

3 participants