Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
2Shirt 2021-05-05 23:43:25 -06:00
commit 23f519102d
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 13 additions and 7 deletions

View file

@ -63,6 +63,7 @@ def download_file(out_path, source_url, as_new=False, overwrite=False):
def download_tool(folder, name): def download_tool(folder, name):
"""Download tool.""" """Download tool."""
name_arch = f'{name}{ARCH}'
out_path = find_kit_dir('.bin').joinpath(f'{folder}/{name}.exe') out_path = find_kit_dir('.bin').joinpath(f'{folder}/{name}.exe')
up_to_date = False up_to_date = False
@ -77,9 +78,15 @@ def download_tool(folder, name):
LOG.info('Skip downloading up-to-date tool: %s', name) LOG.info('Skip downloading up-to-date tool: %s', name)
return return
# Get ARCH specific URL if available
if name_arch in SOURCES:
source_url = SOURCES[name_arch]
out_path = out_path.with_stem(name_arch)
else:
source_url = SOURCES[name]
# Download # Download
LOG.info('Downloading tool: %s', name) LOG.info('Downloading tool: %s', name)
source_url = SOURCES[name]
try: try:
new_file = download_file(out_path, source_url, as_new=True) new_file = download_file(out_path, source_url, as_new=True)
new_file.replace(out_path) new_file.replace(out_path)
@ -140,10 +147,12 @@ def find_kit_dir(name=None):
def get_tool_path(folder, name, check=True): def get_tool_path(folder, name, check=True):
"""Get tool path, returns pathlib.Path""" """Get tool path, returns pathlib.Path"""
bin_dir = find_kit_dir('.bin') bin_dir = find_kit_dir('.bin')
name_arch = f'{name}{ARCH}'
# "Search" # "Search"
tool_path = bin_dir.joinpath(f'{folder}/{name}{ARCH}.exe') tool_path = bin_dir.joinpath(f'{folder}/{name_arch}.exe')
if not tool_path.exists(): if not (tool_path.exists() or name_arch in SOURCES):
# Use "default" path instead
tool_path = tool_path.with_stem(name) tool_path = tool_path.with_stem(name)
# Missing? # Missing?

View file

@ -845,10 +845,7 @@ def run_hitmanpro():
log_path = log_path.with_suffix('.xml') log_path = log_path.with_suffix('.xml')
log_path.parent.mkdir(parents=True, exist_ok=True) log_path.parent.mkdir(parents=True, exist_ok=True)
cmd_args = ['/scanonly', f'/log={log_path}'] cmd_args = ['/scanonly', f'/log={log_path}']
run_tool( run_tool('HitmanPro', 'HitmanPro', *cmd_args, download=True)
'HitmanPro', f'HitmanPro{"64" if ARCH=="64" else ""}',
*cmd_args, download=True,
)
def run_iobit_uninstaller(): def run_iobit_uninstaller():