debloat_registry_tweaks

Path: /debloat_components/debloat_registry_tweaks.py

Overview

This script applies a predefined set of Windows Registry modifications to optimize various system and UI settings for performance, usability, and a consistent dark theme.

Purpose & Use Cases

Automate disabling of context menu delay, animation, and Game DVR features during a Windows debloat process.

Enforce dark theme for both applications and system UI, and adjust advanced Explorer behaviors such as taskbar alignment and file extension visibility.

Dependencies

Python standard library winreg module

Raven Development Team utilities: util_logger, util_error_popup, and util_modify_registry

Configuration & Parameters

Parameter Type Description Default
None N/A No user-configurable parameters; all tweaks are hard-coded. N/A

Usage Example

python debloat_registry_tweaks.py

Behavior & Implementation

On execution, the script defines a list of registry changes—each a tuple of hive, key path, value name, registry data type, and the desired value. It iterates through the list, invoking set_value for each entry. Successful applications log an INFO message; after all entries, a final INFO confirms completion.

Error Handling

If set_value raises an exception for any tweak, the script logs an ERROR, displays a blocking error popup via show_error_popup, and exits immediately with a non-zero status to prevent partial application.

Security Considerations

Modifying HKLM and HKCU registry hives requires appropriate user privileges (typically administrative). All values are predefined, preventing injection risks. Ensure the script runs under a secure, elevated context.

Logging

Uses util_logger at levels INFO and ERROR. Example messages:

INFO: “Applying registry tweak: Software\...\Advanced\TaskbarAl = 0 (type=REG_DWORD)”

ERROR: “Failed to apply registry tweak HideFileExt: [WinError ...]”

Testing & Validation

Manually run on a test VM and verify each registry value via regedit or PowerShell Get-ItemProperty. Unit tests can mock util_modify_registry.set_value to assert correct calls for all defined entries.

Author

Author: Raven Development Team