From d0e9ba6b306ac0161ecd0769b11ef20fa2660847 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Sun, 8 Nov 2026 08:55:59 -0500 Subject: [PATCH] Propose a game folder only on a fixed drive. When the launcher's drive has less than 40 GB free, the proposed game folder goes to the drive with the most free space, and a mapped network share or a USB drive was counted: the 26 GB RomFS image and the build would go there. Only fixed drives are counted now, as the docs say. Co-Authored-By: Claude Opus 5.5 --- launcher/paths.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/launcher/paths.py b/launcher/paths.py index ba6ee7a0..d56ec74d 100644 --- a/launcher/paths.py +++ b/launcher/paths.py @@ -38,6 +38,18 @@ def ansi_safe(path): return False +def fixed_drive(drive): + """True when drive (X:\\) is a fixed disk (GetDriveTypeW DRIVE_FIXED), not a network, removable or optical drive. + True where that cannot be asked.""" + if os.name != 'nt': + return True + try: + import ctypes + return ctypes.windll.kernel32.GetDriveTypeW(str(drive)) == 3 + except (AttributeError, OSError): + return True + + class Layout: def __init__(self, root=None, app=None): self.app = Path(app or APP) @@ -93,6 +105,8 @@ class Layout: import string for letter in string.ascii_uppercase[2:]: drive = Path(f'{letter}:\\') + if not fixed_drive(drive): # a mapped network share or a USB stick is no place for 30 GB of build + continue try: free = shutil.disk_usage(drive).free except OSError: