Added antivirus check to the system_checklist

* Fixes issue #31
This commit is contained in:
2Shirt 2018-05-14 12:11:38 -06:00
parent 8ea17268c7
commit 6868988cec
2 changed files with 35 additions and 1 deletions

View file

@ -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 = []

View file

@ -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)