Add file associations sections

This commit is contained in:
2Shirt 2021-05-02 02:18:23 -06:00
parent b57f50d4b5
commit 6cece2c832
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 30 additions and 1 deletions

View file

@ -51,6 +51,7 @@ BASE_MENUS = {
MenuEntry('CHKDSK', 'auto_chkdsk'),
MenuEntry('DISM RestoreHealth', 'auto_dism'),
MenuEntry('SFC Scan', 'auto_sfc'),
MenuEntry('Fix File Associations', 'auto_fix_file_associations'),
MenuEntry('Clear Proxy Settings', 'auto_reset_proxy'),
MenuEntry('Disable Pending Renames', 'auto_disable_pending_renames'),
MenuEntry('Registry Repairs', 'auto_repair_registry'),

View file

@ -20,7 +20,13 @@ from wk.exe import (
wait_for_procs,
)
from wk.io import delete_folder, rename_item
from wk.kit.tools import ARCH, download_tool, get_tool_path, run_tool
from wk.kit.tools import (
ARCH,
download_tool,
extract_tool,
get_tool_path,
run_tool,
)
from wk.log import format_log_path, update_log_path
from wk.os.win import (
reg_delete_value,
@ -647,6 +653,14 @@ def auto_enable_regback(group, name):
save_settings(group, name, result=result)
def auto_fix_file_associations(group, name):
"""Run Fix File Associations scan."""
result = TRY_PRINT.run(
'Fix File Associations...', fix_file_associations, msg_good='DONE',
)
save_settings(group, name, result=result)
def auto_hitmanpro(group, name):
"""Run HitmanPro scan."""
result = TRY_PRINT.run('HitmanPro...', run_hitmanpro, msg_good='DONE')
@ -791,6 +805,20 @@ def delete_registry_null_keys():
run_tool('RegDelNull', 'RegDelNull', '-s', '-y', cbin=True)
def fix_file_associations():
"""Fix file associations via registry edits."""
extract_tool('WinAIORepair')
winaio_path = get_tool_path('WinAIORepair', 'Repair_Windows').parent
winaio_path = winaio_path.joinpath(
f'Files/regfiles/file_associations/{platform.win32_ver()[0]}',
)
for item in winaio_path.iterdir():
if item.suffix.lower() != '.reg':
continue
cmd = ['reg', 'import', str(item), f'/reg:{ARCH}']
proc = run_program(cmd, check=False)
def run_adwcleaner():
"""Run AdwCleaner."""
run_tool('AdwCleaner', 'AdwCleaner', download=True)