diff --git a/.bin/Scripts/functions/cleanup.py b/.bin/Scripts/functions/cleanup.py index cb400510..92a047a6 100644 --- a/.bin/Scripts/functions/cleanup.py +++ b/.bin/Scripts/functions/cleanup.py @@ -1,6 +1,6 @@ # Wizard Kit: Functions - Cleanup -from functions.common import * +from functions.setup import * # STATIC VARIABLES D7_HKCR_CLEANUP = { @@ -23,6 +23,27 @@ HKU = winreg.HKEY_USERS HKCR = winreg.HKEY_CLASSES_ROOT HKCU = winreg.HKEY_CURRENT_USER HKLM = winreg.HKEY_LOCAL_MACHINE +UAC_DEFAULTS_WIN7 = { + r'Software\Microsoft\Windows\CurrentVersion\Policies\System': { + 'DWORD Items': { + 'ConsentPromptBehaviorAdmin': 5, + 'EnableLUA': 1, + 'PromptOnSecureDesktop': 1, + }, + }, + } +UAC_DEFAULTS_WIN10 = { + r'Software\Microsoft\Windows\CurrentVersion\Policies\System': { + 'DWORD Items': { + 'ConsentPromptBehaviorAdmin': 5, + 'ConsentPromptBehaviorUser': 3, + 'EnableInstallerDetection': 1, + 'EnableLUA': 1, + 'EnableVirtualization': 1, + 'PromptOnSecureDesktop': 1, + }, + }, + } def cleanup_adwcleaner(): """Move AdwCleaner folders into the ClientDir.""" @@ -154,6 +175,13 @@ def cleanup_d7ii(): os.rmdir(d7_path) except OSError: pass + + # Restore default UAC settings + if global_vars['OS']['Version'] == '10': + write_registry_settings(UAC_DEFAULTS_WIN10, all_users=True) + else: + # Haven't checked Win8 settings, only applying minimum set + write_registry_settings(UAC_DEFAULTS_WIN7, all_users=True) def cleanup_desktop(): """Move known backup files and reports into the ClientDir."""