Run AV scans using HIGH priority

Addresses issue #13
This commit is contained in:
2Shirt 2022-02-21 17:45:12 -07:00
parent f3522e42ef
commit 80f9bb6d75
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -28,6 +28,7 @@ from wk.exe import (
get_procs,
run_program,
popen_program,
set_proc_priority,
wait_for_procs,
)
from wk.io import (
@ -1109,10 +1110,14 @@ def run_emsisoft_cmd_scan():
if IN_CONEMU:
cmd.extend(['-new_console:nb', '-new_console:s33V'])
run_program(cmd, check=False, pipe=False)
sleep(1)
sleep(5)
set_proc_priority('a2cmd.exe', 'HIGH')
wait_for_procs('a2cmd.exe')
else:
run_program(cmd, check=False)
proc = popen_program(cmd, priority=True)
sleep(5)
set_proc_priority('a2cmd.exe', 'HIGH')
proc.wait()
def run_hitmanpro():
@ -1121,7 +1126,11 @@ def run_hitmanpro():
log_path = log_path.with_suffix('.xml')
log_path.parent.mkdir(parents=True, exist_ok=True)
cmd_args = ['/scanonly', f'/log={log_path}']
run_tool('HitmanPro', 'HitmanPro', *cmd_args, download=True)
proc = run_tool(
'HitmanPro', 'HitmanPro', *cmd_args,
download=True, popen=True, priority=True,
)
proc.wait()
def run_iobit_uninstaller():
@ -1154,12 +1163,19 @@ def run_kvrt():
_f.write(f'"{kvrt_path}" {" ".join(cmd_args)}\n')
cmd = ('cmd', '/c', tmp_file, '-new_console:nb', '-new_console:s33V')
run_program(cmd, check=False)
sleep(1)
sleep(5)
set_proc_priority('KVRT', 'HIGH', exact=False)
wait_for_procs('KVRT.exe')
return
# Run in background
proc = run_tool('KVRT', 'KVRT', *cmd_args, download=True)
proc = run_tool(
'KVRT', 'KVRT', *cmd_args,
download=True, popen=True, priority=True,
)
sleep(5)
set_proc_priority('KVRT', 'HIGH', exact=False)
proc.wait()
log_path.write_text(proc.stdout, encoding='utf-8')