diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-13 07:59:40 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-13 07:59:40 -0500 |
| commit | 9c029108da47412643c189c61e0e7a909bbdaa45 (patch) | |
| tree | f512cfe4d9ca7c030ce7fdf54e48c9cf209ee32f /libs | |
| parent | de4db79e5158017c002cc91c14fa9e58420e7774 (diff) | |
Fix DDS and winreg missing in Python plugins
- Stage DDS/ package from source directly to plugins/data/DDS/ in
build-inner.sh (cmake MO2_STAGE_PYTHON_PLUGIN_PAYLOAD is OFF by
default so the cmake-sourced path was silently skipped)
- Stage winreg.py from libs/ directly as well (same root cause)
- Guard `import winreg` in gog_utils.py with try/except ImportError
and early-exit to Heroic GOG path if the shim is unavailable
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/basic_games/gog_utils.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/basic_games/gog_utils.py b/libs/basic_games/gog_utils.py index de66ec2..750f739 100644 --- a/libs/basic_games/gog_utils.py +++ b/libs/basic_games/gog_utils.py @@ -5,9 +5,13 @@ from __future__ import annotations import json import sys -import winreg from pathlib import Path +try: + import winreg +except ImportError: + winreg = None # type: ignore[assignment] + def _find_heroic_gog_games() -> dict[str, Path]: """Detect GOG games installed via Heroic Launcher on Linux.""" @@ -44,6 +48,10 @@ def _find_heroic_gog_games() -> dict[str, Path]: def find_games() -> dict[str, Path]: + if winreg is None: + # winreg not available (Linux without shim); use Heroic GOG. + return _find_heroic_gog_games() + # List the game IDs from the registry (Windows): game_ids: list[str] = [] try: |
