diff options
Diffstat (limited to 'libs/basic_games/gog_utils.py')
| -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: |
