Skip to content

Commit

Permalink
[core] Only use override exe on Windows; ensure file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod committed Jun 1, 2022
1 parent f902963 commit fc73c1d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions legendary/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,9 +1435,12 @@ def prepare_download(self, game: Game, base_game: Game = None, base_path: str =

# 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,
Expand Down

0 comments on commit fc73c1d

Please sign in to comment.