From cea5f4242587fa09415a5773511f76d0d7d3f811 Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 3 Jan 2022 15:56:12 +0100 Subject: [PATCH] [cli] Run preqreq installers in shell mode and handle exceptions --- legendary/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/legendary/cli.py b/legendary/cli.py index d54324e..ae20291 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -1039,7 +1039,11 @@ class LegendaryCLI: req_path, req_exec = os.path.split(postinstall['path']) work_dir = os.path.join(igame.install_path, req_path) fullpath = os.path.join(work_dir, req_exec) - subprocess.Popen([fullpath, postinstall['args']], cwd=work_dir) + try: + p = subprocess.Popen([fullpath, postinstall['args']], cwd=work_dir, shell=True) + p.wait() + except Exception as e: + logger.error(f'Failed to run prereq executable with: {e!r}') else: logger.info('Automatic installation not available on Linux.')