mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[cli/core] Add flag to disable WINE
This commit is contained in:
parent
76a0ef6be7
commit
6c9e3a1d62
|
@ -372,7 +372,8 @@ class LegendaryCLI:
|
||||||
params, cwd, env = self.core.get_launch_parameters(app_name=app_name, offline=args.offline,
|
params, cwd, env = self.core.get_launch_parameters(app_name=app_name, offline=args.offline,
|
||||||
extra_args=extra, user=args.user_name_override,
|
extra_args=extra, user=args.user_name_override,
|
||||||
wine_bin=args.wine_bin, wine_pfx=args.wine_pfx,
|
wine_bin=args.wine_bin, wine_pfx=args.wine_pfx,
|
||||||
language=args.language, wrapper=args.wrapper)
|
language=args.language, wrapper=args.wrapper,
|
||||||
|
disable_wine=args.no_wine)
|
||||||
|
|
||||||
logger.info(f'Launching {app_name}...')
|
logger.info(f'Launching {app_name}...')
|
||||||
if args.dry_run:
|
if args.dry_run:
|
||||||
|
@ -847,10 +848,15 @@ def main():
|
||||||
launch_parser.add_argument('--wine-prefix', dest='wine_pfx', action='store', metavar='<wine pfx path>',
|
launch_parser.add_argument('--wine-prefix', dest='wine_pfx', action='store', metavar='<wine pfx path>',
|
||||||
default=os.environ.get('LGDRY_WINE_PREFIX', None),
|
default=os.environ.get('LGDRY_WINE_PREFIX', None),
|
||||||
help='Override WINE prefix used.')
|
help='Override WINE prefix used.')
|
||||||
|
launch_parser.add_argument('--no-wine', dest='no_wine', action='store_true',
|
||||||
|
default=os.environ.get('LGDRY_NO_WINE', None),
|
||||||
|
help='Do not use WINE (e.g. if a wrapper is being used)')
|
||||||
else:
|
else:
|
||||||
# hidden arguments to not break this on Windows
|
# hidden arguments to not break this on Windows
|
||||||
launch_parser.add_argument('--wine', help=argparse.SUPPRESS, dest='wine_bin')
|
launch_parser.add_argument('--wine', help=argparse.SUPPRESS, dest='wine_bin')
|
||||||
launch_parser.add_argument('--wine-prefix', help=argparse.SUPPRESS, dest='wine_pfx')
|
launch_parser.add_argument('--wine-prefix', help=argparse.SUPPRESS, dest='wine_pfx')
|
||||||
|
launch_parser.add_argument('--no-wine', dest='no_wine', help=argparse.SUPPRESS,
|
||||||
|
action='store_true', default=True)
|
||||||
|
|
||||||
list_parser.add_argument('--platform', dest='platform_override', action='store', metavar='<Platform>',
|
list_parser.add_argument('--platform', dest='platform_override', action='store', metavar='<Platform>',
|
||||||
type=str, help='Override platform that games are shown for')
|
type=str, help='Override platform that games are shown for')
|
||||||
|
|
|
@ -230,8 +230,8 @@ class LegendaryCore:
|
||||||
def get_launch_parameters(self, app_name: str, offline: bool = False,
|
def get_launch_parameters(self, app_name: str, offline: bool = False,
|
||||||
user: str = None, extra_args: list = None,
|
user: str = None, extra_args: list = None,
|
||||||
wine_bin: str = None, wine_pfx: str = None,
|
wine_bin: str = None, wine_pfx: str = None,
|
||||||
language: str = None, wrapper: str = None
|
language: str = None, wrapper: str = None,
|
||||||
) -> (list, str, dict):
|
disable_wine: bool = False) -> (list, str, dict):
|
||||||
install = self.lgd.get_installed_game(app_name)
|
install = self.lgd.get_installed_game(app_name)
|
||||||
game = self.lgd.get_game_meta(app_name)
|
game = self.lgd.get_game_meta(app_name)
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ class LegendaryCore:
|
||||||
if wrapper := self.lgd.config.get(app_name, 'wrapper', fallback=wrapper):
|
if wrapper := self.lgd.config.get(app_name, 'wrapper', fallback=wrapper):
|
||||||
params.extend(shlex.split(wrapper))
|
params.extend(shlex.split(wrapper))
|
||||||
|
|
||||||
if os.name != 'nt':
|
if os.name != 'nt' and not disable_wine:
|
||||||
if not wine_bin:
|
if not wine_bin:
|
||||||
# check if there's a default override
|
# check if there's a default override
|
||||||
wine_bin = self.lgd.config.get('default', 'wine_executable', fallback='wine')
|
wine_bin = self.lgd.config.get('default', 'wine_executable', fallback='wine')
|
||||||
|
|
Loading…
Reference in a new issue