Skip to content

Commit 68dc6df

Browse files
authored
Add / extend game detection support for Epic Games (Heroic Games Launcher) (#169)
* Fix Epic game store detection (ProgramData) * Add heroic launcher support for epic games * Add unofficial EGS ID DB to README * Add Epic ID to Subnautica Below Zero * Add Epic ID to Cyberpunk * Add Epic ID to Control
1 parent c0b44c1 commit 68dc6df

5 files changed

Lines changed: 17 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ Game IDs can be found here:
206206
- For Origin from `C:\ProgramData\Origin\LocalContent` (.mfst files)
207207
- For Epic Games (`AppName`) from:
208208
- `C:\ProgramData\Epic\EpicGamesLauncher\Data\Manifests\` (.item files)
209-
- or: `C:\ProgramData\Epic\EpicGamesLauncher\UnrealEngineLauncher\LauncherInstalled.dat`
209+
- or `C:\ProgramData\Epic\EpicGamesLauncher\UnrealEngineLauncher\LauncherInstalled.dat`
210+
- or [Unofficial EGS ID DB](https://erri120.github.io/egs-db/)
210211
- For Legendary (alt. Epic launcher) via command `legendary list-games`
211212
or from: `%USERPROFILE%\.config\legendary\installed.json`
212213
- For EA Desktop from `<EA Games install location>\<game title>\__Installer\installerdata.xml`

epic_utils.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ def find_epic_games() -> Iterable[tuple[str, Path]]:
1616
winreg.HKEY_LOCAL_MACHINE,
1717
r"Software\Wow6432Node\Epic Games\EpicGamesLauncher",
1818
) as key:
19-
epic_app_data_path, _ = winreg.QueryValueEx(key, "AppDataPath")
19+
epic_data_path, _ = winreg.QueryValueEx(key, "AppDataPath")
2020
except FileNotFoundError:
21-
return
21+
epic_data_path = r"%ProgramData%\Epic\EpicGamesLauncher\Data"
2222

23-
manifests_path = Path(os.path.expandvars(epic_app_data_path)).joinpath("Manifests")
23+
manifests_path = Path(os.path.expandvars(epic_data_path)).joinpath("Manifests")
2424
if manifests_path.exists():
2525
for manifest_file_path in manifests_path.glob("*.item"):
2626
try:
@@ -38,10 +38,10 @@ def find_epic_games() -> Iterable[tuple[str, Path]]:
3838
)
3939

4040

41-
def find_legendary_games() -> Iterable[tuple[str, Path]]:
41+
def find_legendary_games(config_path: str | None = None) -> Iterable[tuple[str, Path]]:
4242
# Based on legendary source:
4343
# https://github.com/derrod/legendary/blob/master/legendary/lfs/lgndry.py
44-
if config_path := os.environ.get("XDG_CONFIG_HOME"):
44+
if config_path := config_path or os.environ.get("XDG_CONFIG_HOME"):
4545
legendary_config_path = Path(config_path, "legendary")
4646
else:
4747
legendary_config_path = Path("~/.config/legendary").expanduser()
@@ -61,8 +61,14 @@ def find_legendary_games() -> Iterable[tuple[str, Path]]:
6161
)
6262

6363

64+
def find_heroic_games():
65+
return find_legendary_games(os.path.expandvars(r"%AppData%\heroic\legendaryConfig"))
66+
67+
6468
def find_games() -> dict[str, Path]:
65-
return dict(itertools.chain(find_epic_games(), find_legendary_games()))
69+
return dict(
70+
itertools.chain(find_epic_games(), find_legendary_games(), find_heroic_games())
71+
)
6672

6773

6874
if __name__ == "__main__":

games/game_control.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class ControlGame(BasicGame):
1616
GameNexusId = 2936
1717
GameSteamId = 870780
1818
GameGogId = 2049187585
19+
GameEpicId = "calluna"
1920
GameBinary = "Control.exe"
2021
GameDataPath = ""
2122

games/game_cyberpunk2077.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ class Cyberpunk2077Game(BasicGame):
201201
GameSaveExtension = "dat"
202202
GameSteamId = 1091500
203203
GameGogId = 1423049311
204+
GameEpicId = "77f2b98e2cef40c8a7437518bf420e47"
204205
GameSupportURL = (
205206
r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/"
206207
"Game:-Cyberpunk-2077"

games/game_subnautica-below-zero.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class SubnauticaBelowZeroGame(game_subnautica.SubnauticaGame):
1313
GameShortName = "subnauticabelowzero"
1414
GameNexusName = "subnauticabelowzero"
1515
GameSteamId = 848450
16+
GameEpicId = "foxglove"
1617
GameBinary = "SubnauticaZero.exe"
1718
GameDataPath = "_ROOT"
1819
GameDocumentsDirectory = "%GAME_PATH%"

0 commit comments

Comments
 (0)