From 104d6be8de89d59bd263a72d52cae2a1743a59cb Mon Sep 17 00:00:00 2001 From: Etaash Mathamsetty Date: Sun, 16 Feb 2025 11:54:10 -0500 Subject: [PATCH] add wrapper exe support (cherry picked from commit c9ff491c64fc336496973b3fea0e2373bbb0f9f0) --- legendary/cli.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/legendary/cli.py b/legendary/cli.py index 158e5aa..45bedf0 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -687,15 +687,18 @@ class LegendaryCLI: if args.json: return self._print_json(vars(params), args.pretty_json) + # Copying existing env vars is required on Windows, probably a good idea on Linux + full_env = os.environ.copy() + full_env.update(params.environment) + full_params = list() full_params.extend(params.launch_command) + if 'LEGENDARY_WRAPPER_EXE' in full_env: + full_params.append(full_env['LEGENDARY_WRAPPER_EXE'].strip()) full_params.append(os.path.join(params.game_directory, params.game_executable)) full_params.extend(params.game_parameters) full_params.extend(params.user_parameters) full_params.extend(params.egl_parameters) - # Copying existing env vars is required on Windows, probably a good idea on Linux - full_env = os.environ.copy() - full_env.update(params.environment) if 'CX_BOTTLE' in full_env and any('SharedSupport/CrossOver' in p for p in params.launch_command): # if using crossover, unset WINEPREFIX