From 2ef5401dbbd2fbafb23a84b93e3bdfb34441bc76 Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 23 May 2022 07:45:41 +0200 Subject: [PATCH] [core] Only install into Applications if all files are inside app bundle --- legendary/core.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 05c1829..9d88ca5 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -1335,11 +1335,13 @@ class LegendaryCore: if platform == 'Mac': # if we're on mac and the path to the binary does not start with .app, # treat it as if it were a Windows game instead and install it to the default folder. - if '.app' not in new_manifest.meta.launch_exe.partition('/')[0].lower(): - base_path = self.get_default_install_dir(platform='Windows') - else: + + if all('.app' in fm.filename.partition('/')[0].lower() + for fm in new_manifest.file_manifest_list.elements): # If it is a .app omit the game folder game_folder = '' + else: + base_path = self.get_default_install_dir(platform='Windows') # make sure base directory actually exists (but do not create game dir) if not os.path.exists(base_path):