From 0f481e1f31535ac6d1734fd6fd013b9251df87ea Mon Sep 17 00:00:00 2001 From: derrod Date: Thu, 30 Dec 2021 18:07:06 +0100 Subject: [PATCH] [core/utils] Remove missing folder creation Instead, the manifest will just use zero-byte ".keep" files in empty folders, so they are still created when a bottle is downloaded. --- legendary/core.py | 7 +----- legendary/utils/crossover.py | 44 ------------------------------------ 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 72114b4..88f0363 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -33,7 +33,7 @@ from legendary.models.game import * from legendary.models.json_manifest import JSONManifest from legendary.models.manifest import Manifest, ManifestMeta from legendary.models.chunk import Chunk -from legendary.utils.crossover import mac_find_crossover_apps, mac_get_crossover_version, EMPTY_BOTTLE_DIRECTORIES +from legendary.utils.crossover import mac_find_crossover_apps, mac_get_crossover_version from legendary.utils.egl_crypt import decrypt_epic_data from legendary.utils.env import is_windows_mac_or_pyi from legendary.utils.eos import EOSOverlayApp, query_registry_entries @@ -1865,11 +1865,6 @@ class LegendaryCore: bottles_dir = os.path.expanduser('~/Library/Application Support/CrossOver/Bottles') path = os.path.join(bottles_dir, bottle_name) - self.log.info('Creating missing folders...') - os.makedirs(os.path.join(path, 'dosdevices'), exist_ok=True) - for _dir in EMPTY_BOTTLE_DIRECTORIES: - os.makedirs(os.path.join(path, 'drive_c', _dir), exist_ok=True) - self.log.info('Creating bottle symlinks...') symlinks = [ ('dosdevices/c:', '../drive_c'), diff --git a/legendary/utils/crossover.py b/legendary/utils/crossover.py index b0d85f8..d86ce06 100644 --- a/legendary/utils/crossover.py +++ b/legendary/utils/crossover.py @@ -5,50 +5,6 @@ import subprocess logger = logging.getLogger('CXHelpers') -# all the empty folders found in a freshly created bottle that we will need to create -EMPTY_BOTTLE_DIRECTORIES = [ - 'Program Files/Common Files/Microsoft Shared/TextConv', - 'ProgramData/Microsoft/Windows/Start Menu/Programs/Administrative Tools', - 'ProgramData/Microsoft/Windows/Start Menu/Programs/StartUp', - 'ProgramData/Microsoft/Windows/Templates', - 'users/crossover/AppData/LocalLow', - 'users/crossover/Application Data/Microsoft/Windows/Themes', - 'users/crossover/Contacts', - 'users/crossover/Cookies', - 'users/crossover/Desktop', - 'users/crossover/Favorites', - 'users/crossover/Links', - 'users/crossover/Local Settings/Application Data/Microsoft', - 'users/crossover/Local Settings/History', - 'users/crossover/Local Settings/Temporary Internet Files', - 'users/crossover/NetHood', - 'users/crossover/PrintHood', - 'users/crossover/Recent', - 'users/crossover/Saved Games', - 'users/crossover/Searches', - 'users/crossover/SendTo', - 'users/crossover/Start Menu/Programs/Administrative Tools', - 'users/crossover/Start Menu/Programs/StartUp', - 'users/crossover/Temp', - 'users/Public/Desktop', - 'users/Public/Documents', - 'users/Public/Favorites', - 'users/Public/Music', - 'users/Public/Pictures', - 'users/Public/Videos', - 'windows/Fonts', - 'windows/help', - 'windows/logs', - 'windows/Microsoft.NET/DirectX for Managed Code', - 'windows/system32/mui', - 'windows/system32/spool/printers', - 'windows/system32/tasks', - 'windows/syswow64/drivers', - 'windows/syswow64/mui', - 'windows/tasks', - 'windows/temp' -] - def mac_get_crossover_version(app_path): try: