diff --git a/.bin/Scripts/functions/info.py b/.bin/Scripts/functions/info.py index fbde1a27..b81a4922 100644 --- a/.bin/Scripts/functions/info.py +++ b/.bin/Scripts/functions/info.py @@ -116,6 +116,36 @@ def get_folder_size(path): size = human_readable_size(size) return size +def get_installed_antivirus(): + """Get list of installed Antivirus programs.""" + programs = [] + cmd = ['WMIC', r'/namespace:\\root\SecurityCenter2', + 'path', 'AntivirusProduct', + 'get', 'displayName', '/value'] + out = run_program(cmd) + out = out.stdout.decode().strip() + products = out.splitlines() + products = [p.split('=')[1] for p in products if p] + for prod in sorted(products): + # Get product state and check if it's enabled + # credit: https://jdhitsolutions.com/blog/powershell/5187/get-antivirus-product-status-with-powershell/ + cmd = ['WMIC', r'/namespace:\\root\SecurityCenter2', + 'path', 'AntivirusProduct', + 'where', 'displayName="{}"'.format(prod), + 'get', 'productState', '/value'] + out = run_program(cmd) + out = out.stdout.decode().strip() + state = out.split('=')[1] + state = hex(int(state)) + if str(state)[3:5] != '10': + programs.append('[Disabled] {}'.format(prod)) + else: + programs.append(prod) + + if len(programs) == 0: + programs = ['No programs found'] + return programs + def get_installed_office(): """Get list of installed Office programs.""" programs = [] diff --git a/.bin/Scripts/system_checklist.py b/.bin/Scripts/system_checklist.py index 6e0a1fcb..e0f217ed 100644 --- a/.bin/Scripts/system_checklist.py +++ b/.bin/Scripts/system_checklist.py @@ -75,8 +75,12 @@ if __name__ == '__main__': try_and_print(message='BIOS Activation:', function=activate_with_bios, other_results=other_results) + try_and_print(message='Installed Antivirus:', + function=get_installed_antivirus, ns='Unknown', + other_results=other_results, print_return=True) try_and_print(message='Installed Office:', - function=get_installed_office, ns='Unknown', print_return=True) + function=get_installed_office, ns='Unknown', + other_results=other_results, print_return=True) show_free_space() try_and_print(message='Installed RAM:', function=show_installed_ram, ns='Unknown', silent_function=False)