add wrapper exe support (#777)

(cherry picked from commit c9ff491c64fc336496973b3fea0e2373bbb0f9f0)

Co-authored-by: Etaash Mathamsetty <etaash.mathamsetty@gmail.com>
This commit is contained in:
CommandMC 2026-08-20 15:48:08 +02:00 committed by GitHub
parent 1be4b7e2ba
commit ece601bfb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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