Merge duplicate efforts to restore UAC defaults
This commit is contained in:
parent
659d71c0eb
commit
f7e6f88b9c
5 changed files with 19 additions and 41 deletions
|
|
@ -123,7 +123,6 @@ BASE_MENUS = {
|
|||
MenuEntry('Enable System Restore', 'auto_system_restore_enable'),
|
||||
MenuEntry('Set System Restore Size', 'auto_system_restore_set_size'),
|
||||
MenuEntry('Enable Windows Updates', 'auto_windows_updates_enable'),
|
||||
MenuEntry('User Account Control', 'auto_restore_default_uac'),
|
||||
MenuEntry('Windows Activation', 'auto_activate_windows'),
|
||||
MenuEntry('Windows Explorer', 'auto_config_explorer'),
|
||||
MenuEntry(r'Windows\Temp Fix', 'auto_windows_temp_fix'),
|
||||
|
|
|
|||
|
|
@ -46,12 +46,23 @@ POWER_PLANS = {
|
|||
'Custom': '01189998-8199-9119-725c-ccccccccccc3',
|
||||
'High Performance': '8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c',
|
||||
}
|
||||
REG_UAC_DEFAULT_SETTINGS = {
|
||||
REG_UAC_DEFAULTS_WIN7 = {
|
||||
'HKLM': {
|
||||
r'Software\Microsoft\Windows\CurrentVersion\Policies\System': (
|
||||
('ConsentPromptBehaviorAdmin', 5, 'DWORD'),
|
||||
('EnableLUA', 1, 'DWORD'),
|
||||
('PromptOnSecureDesktop', 1, 'DWORD'),
|
||||
),
|
||||
},
|
||||
}
|
||||
REG_UAC_DEFAULTS_WIN10 = {
|
||||
'HKLM': {
|
||||
r'Software\Microsoft\Windows\CurrentVersion\Policies\System': (
|
||||
('ConsentPromptBehaviorAdmin', 5, 'DWORD'),
|
||||
('ConsentPromptBehaviorUser', 3, 'DWORD'),
|
||||
('EnableInstallerDetection', 1, 'DWORD'),
|
||||
('EnableLUA', 1, 'DWORD'),
|
||||
('EnableVirtualization', 1, 'DWORD'),
|
||||
('PromptOnSecureDesktop', 1, 'DWORD'),
|
||||
),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -121,27 +121,6 @@ REG_OPEN_SHELL_SETTINGS = {
|
|||
),
|
||||
},
|
||||
}
|
||||
REG_UAC_DEFAULTS_WIN7 = {
|
||||
'HKLM': {
|
||||
r'Software\Microsoft\Windows\CurrentVersion\Policies\System': (
|
||||
('ConsentPromptBehaviorAdmin', 5, 'DWORD'),
|
||||
('EnableLUA', 1, 'DWORD'),
|
||||
('PromptOnSecureDesktop', 1, 'DWORD'),
|
||||
),
|
||||
},
|
||||
}
|
||||
REG_UAC_DEFAULTS_WIN10 = {
|
||||
'HKLM': {
|
||||
r'Software\Microsoft\Windows\CurrentVersion\Policies\System': (
|
||||
('ConsentPromptBehaviorAdmin', 5, 'DWORD'),
|
||||
('ConsentPromptBehaviorUser', 3, 'DWORD'),
|
||||
('EnableInstallerDetection', 1, 'DWORD'),
|
||||
('EnableLUA', 1, 'DWORD'),
|
||||
('EnableVirtualization', 1, 'DWORD'),
|
||||
('PromptOnSecureDesktop', 1, 'DWORD'),
|
||||
),
|
||||
},
|
||||
}
|
||||
UBLOCK_ORIGIN_URLS = {
|
||||
'Google Chrome': 'https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm',
|
||||
'Microsoft Edge': 'https://microsoftedge.microsoft.com/addons/detail/ublock-origin/odfafepnkmbhccpbejgmiehpchacaeak',
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ from wk.cfg.repairs import (
|
|||
AUTO_REPAIR_KEY,
|
||||
BLEACH_BIT_CLEANERS,
|
||||
POWER_PLANS,
|
||||
REG_UAC_DEFAULT_SETTINGS,
|
||||
REG_UAC_DEFAULTS_WIN7,
|
||||
REG_UAC_DEFAULTS_WIN10,
|
||||
WIDTH,
|
||||
)
|
||||
from wk.exe import (
|
||||
|
|
@ -1265,7 +1266,11 @@ def reset_windows_updates():
|
|||
|
||||
def restore_uac_defaults():
|
||||
"""Restore UAC default settings."""
|
||||
reg_write_settings(REG_UAC_DEFAULT_SETTINGS)
|
||||
settings = REG_UAC_DEFAULTS_WIN10
|
||||
if OS_VERSION != 10:
|
||||
settings = REG_UAC_DEFAULTS_WIN7
|
||||
|
||||
reg_write_settings(settings)
|
||||
|
||||
|
||||
def run_chkdsk_offline():
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ from wk.cfg.setup import (
|
|||
REG_CHROME_UBLOCK_ORIGIN,
|
||||
REG_WINDOWS_EXPLORER,
|
||||
REG_OPEN_SHELL_SETTINGS,
|
||||
REG_UAC_DEFAULTS_WIN7,
|
||||
REG_UAC_DEFAULTS_WIN10,
|
||||
UBLOCK_ORIGIN_URLS,
|
||||
)
|
||||
from wk.exe import kill_procs, run_program, popen_program
|
||||
|
|
@ -510,11 +508,6 @@ def auto_open_xmplay():
|
|||
TRY_PRINT.run('XMPlay...', open_xmplay)
|
||||
|
||||
|
||||
def auto_restore_default_uac():
|
||||
"""Restore default UAC settings."""
|
||||
TRY_PRINT.run('User Account Control...', restore_default_uac)
|
||||
|
||||
|
||||
def auto_show_4k_alignment_check():
|
||||
"""Display 4K alignment check."""
|
||||
TRY_PRINT.run('4K alignment Check...', check_4k_alignment, show_alert=True)
|
||||
|
|
@ -658,15 +651,6 @@ def fix_windows_temp():
|
|||
run_program(cmd)
|
||||
|
||||
|
||||
def restore_default_uac():
|
||||
"""Restore default UAC settings."""
|
||||
settings = REG_UAC_DEFAULTS_WIN10
|
||||
if OS_VERSION != 10:
|
||||
settings = REG_UAC_DEFAULTS_WIN7
|
||||
|
||||
reg_write_settings(settings)
|
||||
|
||||
|
||||
# Install Functions
|
||||
def install_firefox():
|
||||
"""Install Firefox.
|
||||
|
|
|
|||
Loading…
Reference in a new issue