From 251c232a6e4302fa78b8ccd2d4d3617dd39637ab Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 19 Aug 2018 12:50:36 -0700 Subject: [PATCH] Added Emsisoft a2cmd to system_checklist cleanup --- .bin/Scripts/functions/cleanup.py | 19 +++++++++++++++++++ .bin/Scripts/system_checklist.py | 6 ++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.bin/Scripts/functions/cleanup.py b/.bin/Scripts/functions/cleanup.py index 1bac4c6c..bd2e3ec2 100644 --- a/.bin/Scripts/functions/cleanup.py +++ b/.bin/Scripts/functions/cleanup.py @@ -87,5 +87,24 @@ def cleanup_desktop(): except OSError: pass +def cleanup_emsisoft(): + """Remove EmsisoftCmd files from drive root.""" + source_path = r'{}\EmsisoftCmd'.format(global_vars['Env']['SYSTEMDRIVE']) + source_quarantine = r'{}\Quarantine'.format(source_path) + + # Quarantine + if os.path.exists(source_quarantine): + os.makedirs(global_vars['QuarantineDir'], exist_ok=True) + dest_name = r'{QuarantineDir}\Emsisoft_{Date-Time}'.format( + **global_vars) + dest_name = non_clobber_rename(dest_name) + shutil.move(source_quarantine, dest_name) + + # Remove program + if os.path.exists(source_path): + shutil.rmtree(source_path) + if __name__ == '__main__': print("This file is not meant to be called directly.") + +# vim: sts=4 sw=4 ts=4 diff --git a/.bin/Scripts/system_checklist.py b/.bin/Scripts/system_checklist.py index 33865daa..788af936 100644 --- a/.bin/Scripts/system_checklist.py +++ b/.bin/Scripts/system_checklist.py @@ -44,10 +44,12 @@ if __name__ == '__main__': # Cleanup print_info('Cleanup') - try_and_print(message='Desktop...', - function=cleanup_desktop, cs='Done') try_and_print(message='AdwCleaner...', function=cleanup_adwcleaner, cs='Done', other_results=other_results) + try_and_print(message='Desktop...', + function=cleanup_desktop, cs='Done') + try_and_print(message='Emsisoft a2cmd...', + function=cleanup_emsisoft, cs='Done') # Export system info if not D7_MODE: