From fc73c1d4bf01a4680a09c36378989e1b75f89e92 Mon Sep 17 00:00:00 2001 From: derrod Date: Wed, 1 Jun 2022 12:56:57 +0200 Subject: [PATCH] [core] Only use override exe on Windows; ensure file exists --- legendary/core.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 8df585f..3a505f8 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -1435,9 +1435,12 @@ class LegendaryCore: # Override exe at an install level to avoid breaking existing config overrides executable = new_manifest.meta.launch_exe - if exe_override := get_exe_override(app_name=game.app_name): - self.log.info(f'Launch exe will be changed from "{executable}" to "{exe_override}" for compatibility') - executable = exe_override + if platform != 'Mac' and (exe_override := get_exe_override(app_name=game.app_name)): + exe_override_l = exe_override.lower() + # make sure that override exe even exists + if any(fm.filename.lower() == exe_override_l for fm in new_manifest.file_manifest_list.elements): + self.log.info(f'Launch exe will be changed from "{executable}" to "{exe_override}" for compatibility') + executable = exe_override igame = InstalledGame(app_name=game.app_name, title=game.app_title, version=new_manifest.meta.build_version, prereq_info=prereq,