diff --git a/scripts/auto_repairs.py b/scripts/auto_repairs.py index ccb7ff56..f21ebff5 100644 --- a/scripts/auto_repairs.py +++ b/scripts/auto_repairs.py @@ -64,7 +64,9 @@ BASE_MENUS = { MenuEntry('BleachBit', 'auto_bleachbit'), MenuEntry('HitmanPro', 'auto_hitmanpro'), MenuEntry('KVRT', 'auto_kvrt'), - MenuEntry('EmsisoftCmd', 'auto_emsisoft_cmd'), + MenuEntry('EmsisoftCmd', 'auto_emsisoft_cmd_run'), + MenuEntry('Reboot', 'auto_reboot'), + MenuEntry('EmsisoftCmd (Uninstall)', 'auto_emsisoft_cmd_uninstall'), MenuEntry('Windows Defender', 'auto_microsoft_defender'), MenuEntry('Remove Custom Power Plan', 'auto_remove_power_plan'), MenuEntry('Reboot', 'auto_reboot'), diff --git a/scripts/wk/repairs/win.py b/scripts/wk/repairs/win.py index 39305fae..982a7a63 100644 --- a/scripts/wk/repairs/win.py +++ b/scripts/wk/repairs/win.py @@ -657,12 +657,18 @@ def auto_dism(group, name): reboot() -def auto_emsisoft_cmd(group, name): +def auto_emsisoft_cmd_run(group, name): """Run EmisoftCmd.""" TRY_PRINT.run('EmsisoftCmd (Install)...', install_emsisoft_cmd) TRY_PRINT.run('EmsisoftCmd (Update)...', update_emsisoft_cmd) result = TRY_PRINT.run('EmsisoftCmd (Scan)...', run_emsisoft_cmd_scan) - TRY_PRINT.run('EmsisoftCmd (Uninstall)...', uninstall_emsisoft_cmd) + TRY_PRINT.run('EmsisoftCmd (Uninstall Service)...', delete_emsisoft_cmd_service) + save_settings(group, name, result=result) + + +def auto_emsisoft_cmd_uninstall(group, name): + """Uninstall EmsisoftCmd.""" + result = TRY_PRINT.run('EmsisoftCmd (Uninstall)...', uninstall_emsisoft_cmd) save_settings(group, name, result=result) @@ -973,6 +979,17 @@ def backup_registry(): run_tool('ERUNT', 'ERUNT', backup_path, 'sysreg', 'curuser', 'otherusers') +def delete_emsisoft_cmd_service(): + """Delete EmsisoftCmd service.""" + try: + stop_service('epp') + except GenericError: + pass + + # Delete service + run_program(['sc', 'delete', 'epp'], check=False) + + def delete_registry_null_keys(): """Delete registry keys with embedded null characters.""" run_tool('RegDelNull', 'RegDelNull', '-s', '-y', download=True) @@ -1205,22 +1222,7 @@ def run_tdsskiller(): def uninstall_emsisoft_cmd(): - """Uninstall EmsisoftCmd. - - NOTE: If the epp service was installed previously then it may get in - the way. Just in case this wil attempt to stop and delete it. - """ - try: - stop_service('epp') - except GenericError: - # Ignore and delete *most* of EmsisoftCmd - pass - - # Delete service (if possible / present) - run_program(['sc', 'delete', 'epp'], check=False) - - # Delete install dir - ## NOTE: Using ingore_errors=True in case service dll can't be removed. + """Uninstall EmsisoftCmd.""" delete_folder(EMSISOFT_INSTALL_PATH, force=True, ignore_errors=True)