debloat_execute_raven_scripts

Path: debloat_components/debloat_execute_raven_scripts.py

Overview

This script executes a predefined set of Raven debloat PowerShell scripts, handling logging and user-facing error popups.

Purpose & Use Cases

Automate execution of Raven-provided debloat scripts for system cleanup and optimization.

Provide clear logging and GUI error notifications when PowerShell scripts fail.

Dependencies

utilities.util_logger for logging events.

utilities.util_powershell_handler for executing PowerShell scripts.

utilities.util_error_popup for displaying error dialogs to the user.

Configuration & Parameters

Parameter Type Description Default
scripts list List of PowerShell script filenames to execute. ["edge_vanisher.ps1", "uninstall_oo.ps1"]

Usage Example

python debloat_execute_raven_scripts.py

Behavior & Implementation

When run, the script iterates over each entry in the scripts list, logs the start of execution, and invokes run_powershell_script. On success, it logs a confirmation. After all scripts run successfully, it logs a final success message.

Error Handling

If a script fails, the exception is caught, an error is logged, and show_error_popup displays an error dialog with the script name and exception details. The script then exits with a non-zero status to prevent further operations.

Security Considerations

Executing PowerShell scripts requires appropriate system privileges. Ensure scripts are obtained from trusted Raven Development Team sources to avoid executing malicious code.

Logging

Uses logger.info for progress messages like “Executing PowerShell script: edge_vanisher.ps1” and “✔ Successfully executed edge_vanisher.ps1”. Uses logger.error for errors such as “✖ Failed to execute uninstall_oo.ps1: {error}”.

Testing & Validation

Run the script in a controlled environment (e.g., a virtual machine) and verify logs to confirm each PowerShell script executes correctly. Simulate failure cases by renaming a script to ensure error handling and popups function as expected.

Author

Author: Raven Development Team