Path: /debloat_components/debloat_configure_updates.py
This component detects the Windows edition and applies the corresponding Windows Update policy by executing the appropriate PowerShell script.
Automate configuration of Windows Update settings in enterprise or professional environments to enforce update policies.
Enable standardized update behavior on Home editions by applying default policy scripts.
Python winreg module for registry access
utilities.util_powershell_handler for executing PowerShell scripts
utilities.util_logger for logging informational and error messages
utilities.util_error_popup for displaying errors in a GUI popup
Parameter | Type | Description | Default |
---|---|---|---|
None | N/A | No user-configurable parameters; script auto-selects policy changer based on edition | N/A |
python debloat_configure_updates.py
On execution, the script reads the ProductName value from HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion to determine the Windows edition. If the edition contains “Professional”, “Pro”, or “Enterprise”, it selects update_policy_changer_pro.ps1; otherwise it uses update_policy_changer.ps1. It then invokes run_powershell_script to apply the update policy.
Exceptions reading the registry or running the PowerShell script are caught and logged at ERROR level. A GUI error popup is displayed via show_error_popup, and the script exits with a non-zero status on failure.
Requires administrative privileges to modify update policies. Ensure scripts are sourced from trusted locations to avoid arbitrary code execution.
Uses util_logger at INFO and ERROR levels. Example messages:
INFO: Detected product name: Windows 10 Pro
INFO: Executing PowerShell script: update_policy_changer_pro.ps1
ERROR: ✖ Failed to execute update_policy_changer_pro.ps1: [error details]
Run manually on both Pro/Enterprise and Home editions. Verify the appropriate PowerShell script executes without errors and that update policies are applied as expected. Unit tests can mock winreg and run_powershell_script to simulate behavior.
Author: Raven Development Team