[cli] Add CrossOver support to Origin launch

This commit is contained in:
derrod 2021-12-30 14:03:50 +01:00
parent b8e5dac0d6
commit 300110e2bc

View file

@ -765,11 +765,26 @@ class LegendaryCLI:
# on linux, require users to specify at least the wine binary and prefix in config or command line # on linux, require users to specify at least the wine binary and prefix in config or command line
command = self.core.get_app_launch_command(args.app_name, wrapper=args.wrapper, command = self.core.get_app_launch_command(args.app_name, wrapper=args.wrapper,
wine_binary=args.wine_bin, wine_binary=args.wine_bin,
disable_wine=args.no_wine) disable_wine=args.no_wine,
env = self.core.get_app_environment(args.app_name, wine_pfx=args.wine_pfx) crossover_app=args.crossover_app)
env = self.core.get_app_environment(args.app_name, wine_pfx=args.wine_pfx,
cx_bottle=args.crossover_bottle)
full_env = os.environ.copy() full_env = os.environ.copy()
full_env.update(env) full_env.update(env)
if 'CX_BOTTLE' in full_env:
# if using crossover, unset WINEPREFIX
full_env.pop('WINEPREFIX', None)
# check that bottle is valid, show error otherwise
bottle_name = full_env["CX_BOTTLE"].strip()
if not mac_is_valid_bottle(bottle_name):
if bottle_name == 'Legendary':
logger.error('Attempted to use default CrossOver bottle ("Legendary"), but it does not exist, '
'see https://legendary.gl/crossover-setup for setup instructions.')
else:
logger.error(f'Specified CrossOver bottle {bottle_name} does not exist, cannot launch.')
exit(1)
if not command: if not command:
logger.error(f'In order to launch Origin correctly you must specify a prefix and wine binary or ' logger.error(f'In order to launch Origin correctly you must specify a prefix and wine binary or '
f'wrapper in the configuration file or command line. See the README for details.') f'wrapper in the configuration file or command line. See the README for details.')