1+ """ Import necessary modules for the program to work """
12import sys
23import ctypes
34import os
1011import logging
1112import json
1213
14+
15+
16+ """ Set up the log file """
1317LOG_FILE = "talon.txt"
1418logging .basicConfig (
1519 filename = LOG_FILE ,
1620 level = logging .INFO ,
1721 format = "%(asctime)s - %(levelname)s - %(message)s" ,
1822)
1923
24+
25+
26+ """ Utility function to log outputs """
2027def log (message ):
2128 logging .info (message )
2229 print (message )
2330
31+
32+
33+ """ Utility function to check if the program is running as administrator """
2434def is_admin ():
2535 try :
2636 return ctypes .windll .shell32 .IsUserAnAdmin ()
2737 except :
2838 return False
2939
40+
41+
42+ """ If the program is not running as administrator, attempt to elevate """
3043if not is_admin ():
3144 ctypes .windll .shell32 .ShellExecuteW (
3245 None , "runas" , sys .executable , " " .join (sys .argv ), None , 1
3346 )
3447 sys .exit (0 )
3548
49+
50+
51+ """ Apply modifications done via the Windows registry """
3652def apply_registry_changes ():
3753 log ("Applying registry changes..." )
3854 try :
@@ -51,6 +67,8 @@ def apply_registry_changes():
5167 (winreg .HKEY_CURRENT_USER , r"Control Panel\\Desktop\\WindowMetrics" , "MinAnimate" , winreg .REG_DWORD , 0 ),# Disable minimize/maximize animations
5268 (winreg .HKEY_CURRENT_USER , r"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced" , "ExtendedUIHoverTime" , winreg .REG_DWORD , 1 ),# Reduce hover time for tooltips and UI elements
5369 (winreg .HKEY_CURRENT_USER , r"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced" , "HideFileExt" , winreg .REG_DWORD , 0 ),# Show file extensions in Explorer (useful for security and organization)
70+ (winreg .HKEY_CURRENT_USER , r"Control Panel\\Colors" , "Hilight" , winreg .REG_SZ , "0 0 0" ), # Sets highlight color to black
71+ (winreg .HKEY_CURRENT_USER , r"Control Panel\\Colors" , "HotTrackingColor" , winreg .REG_SZ , "0 0 0" ), # Sets the click-and-drag box color to black
5472 ]
5573 for root_key , key_path , value_name , value_type , value in registry_modifications :
5674 try :
@@ -69,6 +87,9 @@ def apply_registry_changes():
6987 except Exception as e :
7088 log (f"Error applying registry changes: { e } " )
7189
90+
91+
92+ """ Run a script to remove Edge, and prevent reinstallation """
7293def run_edge_vanisher ():
7394 log ("Starting Edge Vanisher script execution..." )
7495 try :
@@ -116,6 +137,9 @@ def run_edge_vanisher():
116137 log (f"Unexpected error during Edge Vanisher execution: { str (e )} " )
117138 run_oouninstall ()
118139
140+
141+
142+ """ Run a script to remove OneDrive and Outlook """
119143def run_oouninstall ():
120144 log ("Starting Office Online uninstallation process..." )
121145 try :
@@ -155,6 +179,9 @@ def run_oouninstall():
155179 log (f"Unexpected error during OO uninstallation: { str (e )} " )
156180 run_tweaks ()
157181
182+
183+
184+ """ Run ChrisTitusTech's WinUtil to debloat the system (Thanks Chris, you're a legend!) """
158185def run_tweaks ():
159186 logging .basicConfig (
160187 level = logging .INFO ,
@@ -226,6 +253,9 @@ def run_tweaks():
226253 run_applybackground ()
227254 os ._exit (1 )
228255
256+
257+
258+ """ Run a program to set the background of the system """
229259def run_applybackground ():
230260 log ("Starting ApplyBackground tweaks..." )
231261 try :
@@ -280,6 +310,9 @@ def run_applybackground():
280310 log (f"Error in ApplyBackground: { str (e )} " )
281311 run_winconfig ()
282312
313+
314+
315+ """ Run Raphi's Win11Debloat script to further debloat the system (Thanks Raphire!) """
283316def run_winconfig ():
284317 log ("Starting Windows configuration process..." )
285318 try :
@@ -301,6 +334,8 @@ def run_winconfig():
301334 f"& '{ script_path } ' -Silent -RemoveApps -RemoveGamingApps -DisableTelemetry "
302335 f"-DisableBing -DisableSuggestions -DisableLockscreenTips -RevertContextMenu "
303336 f"-TaskbarAlignLeft -HideSearchTb -DisableWidgets -DisableCopilot -ExplorerToThisPC"
337+ f"-ClearStartAllUsers -DisableDVR -DisableStartRecommended -ExplorerToThisPC"
338+ f"-DisableMouseAcceleration"
304339 )
305340 log (f"Executing PowerShell command with parameters:" )
306341 log (f"Command: { powershell_command } " )
@@ -360,6 +395,9 @@ def run_winconfig():
360395 log (f"Failed to start UpdatePolicyChanger after unexpected error: { inner_e } " )
361396 run_updatepolicychanger ()
362397
398+
399+
400+ """ Run a script to establish an update policy which only accepts security updates """
363401def run_updatepolicychanger ():
364402 log ("Starting UpdatePolicyChanger script execution..." )
365403 log ("Checking system state before UpdatePolicyChanger execution..." )
@@ -443,6 +481,8 @@ def run_updatepolicychanger():
443481 finalize_installation ()
444482
445483
484+
485+ """ Finalize installation by restarting """
446486def finalize_installation ():
447487 log ("Installation complete. Restarting system..." )
448488 try :
@@ -454,5 +494,8 @@ def finalize_installation():
454494 except Exception as e :
455495 log (f"Failed to restart system: { e } " )
456496
497+
498+
499+ """ Run the program """
457500if __name__ == "__main__" :
458501 apply_registry_changes ()
0 commit comments