{"id":18996021,"url":"https://github.com/erri120/gamefinder","last_synced_at":"2025-05-16T11:07:01.391Z","repository":{"id":40678400,"uuid":"339350600","full_name":"erri120/GameFinder","owner":"erri120","description":".NET library for finding games.","archived":false,"fork":false,"pushed_at":"2025-05-13T19:23:13.000Z","size":929,"stargazers_count":66,"open_issues_count":22,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-16T11:06:56.060Z","etag":null,"topics":["csharp","epic-games-store","gog-galaxy","origin","steam"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erri120.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"ko_fi":"erri120","github":["erri120"]}},"created_at":"2021-02-16T09:45:19.000Z","updated_at":"2025-04-29T10:50:12.000Z","dependencies_parsed_at":"2024-01-03T01:00:26.665Z","dependency_job_id":"08da61e5-1953-44e0-bd20-a8e672a4553f","html_url":"https://github.com/erri120/GameFinder","commit_stats":{"total_commits":362,"total_committers":3,"mean_commits":"120.66666666666667","dds":0.04419889502762431,"last_synced_commit":"cd6ff0efd21fb6c1f82d97e22206a71f9ca7ef19"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erri120%2FGameFinder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erri120%2FGameFinder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erri120%2FGameFinder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erri120%2FGameFinder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erri120","download_url":"https://codeload.github.com/erri120/GameFinder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518381,"owners_count":22084374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","epic-games-store","gog-galaxy","origin","steam"],"created_at":"2024-11-08T17:33:39.942Z","updated_at":"2025-05-16T11:06:56.374Z","avatar_url":"https://github.com/erri120.png","language":"C#","funding_links":["https://ko-fi.com/erri120","https://github.com/sponsors/erri120"],"categories":[],"sub_categories":[],"readme":"# GameFinder\n\n[![CI](https://github.com/erri120/GameFinder/actions/workflows/ci.yml/badge.svg)](https://github.com/erri120/GameFinder/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/erri120/GameFinder/branch/master/graph/badge.svg?token=10PVRFWH39)](https://codecov.io/gh/erri120/GameFinder)\n\n.NET library for finding games. The following launchers are supported:\n\n- [Steam](#steam) [![Nuget](https://img.shields.io/nuget/v/GameFinder.StoreHandlers.Steam)](https://www.nuget.org/packages/GameFinder.StoreHandlers.Steam)\n- [GOG Galaxy](#gog-galaxy) [![Nuget](https://img.shields.io/nuget/v/GameFinder.StoreHandlers.GOG)](https://www.nuget.org/packages/GameFinder.StoreHandlers.GOG)\n- [Epic Games Store](#epic-games-store) [![Nuget](https://img.shields.io/nuget/v/GameFinder.StoreHandlers.EGS)](https://www.nuget.org/packages/GameFinder.StoreHandlers.EGS)\n- [Origin](#origin) [![Nuget](https://img.shields.io/nuget/v/GameFinder.StoreHandlers.Origin)](https://www.nuget.org/packages/GameFinder.StoreHandlers.Origin)\n- [EA Desktop](#ea-desktop) [![Nuget](https://img.shields.io/nuget/v/GameFinder.StoreHandlers.EADesktop)](https://www.nuget.org/packages/GameFinder.StoreHandlers.EADesktop)\n- [Xbox Game Pass](#xbox-game-pass) [![Nuget](https://img.shields.io/nuget/v/GameFinder.StoreHandlers.Xbox)](https://www.nuget.org/packages/GameFinder.StoreHandlers.Xbox)\n- Heroic [![Nuget](https://img.shields.io/nuget/v/GameFinder.Launcher.Heroic)](https://www.nuget.org/packages/GameFinder.Launcher.Heroic)\n\nThe following launchers are not yet supported or support has been dropped:\n\n- [Bethesda.net](#bethesdanet) [![Nuget](https://img.shields.io/nuget/v/GameFinder.StoreHandlers.BethNet?color=red\u0026label=deprecated)](https://www.nuget.org/packages/GameFinder.StoreHandlers.BethNet)\n\nIf you are interested in understanding _how_ GameFinder finds these games, check [the wiki](https://github.com/erri120/GameFinder/wiki) for more information.\n\nAdditionally, the following Linux tools are supported:\n\n- [Wine](#wine) [![Nuget](https://img.shields.io/nuget/v/GameFinder.Wine)](https://www.nuget.org/packages/GameFinder.Wine)\n\n## Example\n\nThe [example project](./other/GameFinder.Example) uses every available store handler and can be used as a reference. You can go to the [GitHub Actions Page](https://github.com/erri120/GameFinder/actions/workflows/ci.yml) and click on one of the latest CI workflow runs to download a build of this project.\n\n## Usage\n\nAll store handlers inherit from `AHandler\u003cTGame, TId\u003e` and implement `FindAllGames()` which returns `IEnumerable\u003cOneOf\u003cTGame, ErrorMessage\u003e\u003e`. The [`OneOf`](https://github.com/mcintyre321/OneOf) struct is a F# style union and is guaranteed to only contain _one of_ the following: a `TGame` or an `ErrorMessage`. I recommended checking out the [OneOf library](https://github.com/mcintyre321/OneOf), if you want to learn more.\n\nSome **important** things to remember:\n\n- All store handler methods are _pure_, meaning they do not change the internal state of the store handler because they don't have any. This also means that the **results are not cached** and you **shouldn't call the same method multiple times**. It's up to the library consumer to cache the results somewhere.\n- Ids are **store dependent**. Each store handler has their own type of id and figuring out the right id for your game might require some testing. You can find useful resources in this README for some store handlers.\n\n### Basic Usage\n\n```csharp\nvar results = handler.FindAllGames();\n\nforeach (var result in results)\n{\n    // using the switch method\n    result.Switch(game =\u003e\n    {\n        Console.WriteLine($\"Found {game}\");\n    }, error =\u003e\n    {\n        Console.WriteLine(error);\n    });\n\n    // using the provided extension functions\n    if (result.TryGetGame(out var game))\n    {\n        Console.WriteLine($\"Found {game}\");\n    } else\n    {\n        Console.WriteLine(result.AsError());\n    }\n}\n```\n\n### Finding a single game\n\nIf you're working on an application that only needs to find **1** game, then you can use the `FindOneGameById` method instead. **IMPORTANT NOTE: the results are not cached**. If you call this method multiple, the store handler will do the same thing multiple times, which is search for every game installed. Do not call this method if you need to [find multiple games](#finding-multiple-games).\n\n```csharp\nvar game = handler.FindOneGameById(someId, out var errors);\n\n// I highly recommend logging errors regardless of whether or not the game was found.\nforeach (var error in errors)\n{\n    Console.WriteLine(error);\n}\n\nif (game is null)\n{\n    Console.WriteLine(\"Unable to find game\");\n} else\n{\n    Console.WriteLine($\"Found {game}\");\n}\n```\n\n### Finding multiple games\n\nIf you need to find multiple games at once, you can use the `FindAllGamesById` method instead. This returns an `IReadOnlyDictionary\u003cTId, TGame\u003e` which you can use to lookup games by id. **IMPORTANT NOTE: the results are not cached**. You have to do that yourself.\n\n```csharp\nvar games = handler.FindAllGamesById(out var errors);\n\n// I highly recommend always logging errors.\nforeach (var error in errors)\n{\n    Console.WriteLine(error);\n}\n\nif (games.TryGetValue(someId, out var game))\n{\n    Console.WriteLine($\"Found {game}\");\n} else\n{\n    Console.WriteLine($\"Unable to find game with the id {someId}\");\n}\n```\n\n## Supported Launchers\n\n### Steam\n\nSteam is supported natively on Windows and Linux. Use [SteamDB](https://steamdb.info/) to find the ID of a game.\n\n**Usage (cross-platform):**\n\n```csharp\nvar handler = new SteamHandler(FileSystem.Shared, OperatingSystem.IsWindows() ? WindowsRegistry.Shared : null);\n```\n\n### GOG Galaxy\n\nGOG Galaxy is supported natively on Windows, and with [Wine](#wine) on Linux. Use the [GOG Database](https://www.gogdb.org/) to find the ID of a game.\n\n**Usage (native on Windows):**\n\n```csharp\nvar handler = new GOGHandler(WindowsRegistry.Shared, FileSystem.Shared);\n```\n\n**Usage (Wine on Linux):**\n\nSee [Wine](#wine) for more information.\n\n```csharp\n// requires a valid prefix\nvar wineFileSystem = winePrefix.CreateOverlayFileSystem(FileSystem.Shared);\nvar wineRegistry = winePrefix.CreateRegistry(FileSystem.Shared);\n\nvar handler = new GOGHandler(wineRegistry, wineFileSystem);\n```\n\n### Epic Games Store\n\nThe Epic Games Store is supported natively on Windows, and with [Wine](#wine) on Linux. Use the [Epic Games Store Database](https://github.com/erri120/egs-db) to find the ID of a game (**WIP**).\n\n**Usage (native on Windows):**\n\n```csharp\nvar handler = new EGSHandler(WindowsRegistry.Shared, FileSystem.Shared);\n```\n\n**Usage (Wine on Linux):**\n\nSee [Wine](#wine) for more information.\n\n```csharp\n// requires a valid prefix\nvar wineFileSystem = winePrefix.CreateOverlayFileSystem(FileSystem.Shared);\nvar wineRegistry = winePrefix.CreateRegistry(FileSystem.Shared);\n\nvar handler = new EGSHandler(wineRegistry, wineFileSystem);\n```\n\n### Origin\n\nOrigin is supported natively on Windows, and with [Wine](#wine) on Linux. **Note:** [EA is deprecating Origin](https://www.ea.com/en-gb/news/ea-app) and will replace it with [EA Desktop](#ea-desktop).\n\n**Usage (native on Windows):**\n\n```csharp\nvar handler = new OriginHandler(FileSystem.Shared);\n```\n\n**Usage (Wine on Linux):**\n\nSee [Wine](#wine) for more information.\n\n```csharp\n// requires a valid prefix\nvar wineFileSystem = winePrefix.CreateOverlayFileSystem(FileSystem.Shared);\n\nvar handler = new OriginHandler(wineFileSystem);\n```\n\n### EA Desktop\n\nEA Desktop is the replacement for [Origin](#origin): See [EA is deprecating Origin](https://www.ea.com/en-gb/news/ea-app). This is by far, the most complicated Store Handler. **You should read the [wiki entry](https://github.com/erri120/GameFinder/wiki/EA-Desktop).** My implementation decrypts the encrypted file, created by EA Desktop. You should be aware that the key used to encrypt the file is derived from hardware information. If the user changes their hardware, the decryption process might fail because they key has changed.\n\nEA Desktop is only supported on Windows.\n\n**Usage:**\n\n```csharp\nvar handler = new EADesktopHandler(FileSystem.Shared, new HardwareInfoProvider());\n```\n\n### Xbox Game Pass\n\nThis package used to be deprecated, but I've re-added support in GameFinder [3.0.0](./CHANGELOG.md#300---2023-05-09). Xbox Game Pass used to install games inside a `SYSTEM` protected folder, making modding not feasible for the average user. You can read more about this [here](https://github.com/Nexus-Mods/NexusMods.App/issues/175).\n\nXbox Game Pass is only supported on Windows.\n\n**Usage:**\n\n```csharp\nvar handler = new XboxHandler(FileSystem.Shared);\n```\n\n### Bethesda.net\n\n[As of May 11, 2022, the Bethesda.net launcher is no longer in use](https://bethesda.net/en/article/2RXxG1y000NWupPalzLblG/sunsetting-the-bethesda-net-launcher-and-migrating-to-steam). The package [GameFinder.StoreHandlers.BethNet](https://www.nuget.org/packages/GameFinder.StoreHandlers.BethNet/) has been deprecated and marked as _legacy_.\n\n\n## Wine\n\n[Wine](https://www.winehq.org/) is a compatibility layer capable of running Windows applications on Linux. Wine uses [prefixes](https://wiki.winehq.org/FAQ#Wineprefixes) to create and store virtual `C:` drives. A user can install and run Windows program inside these prefixes, and applications running inside the prefixes likely won't even notice they are not actually running on Windows.\n\nSince GameFinder is all about finding games, it also has to be able to find games inside Wine prefixes to provide good Linux support. The package `NexusMods.Paths` from [NexusMods.App](https://github.com/Nexus-Mods/NexusMods.App) provides a file system abstraction `IFileSystem` which enables path re-mappings:\n\n```csharp\nAWinePrefix prefix = //...\n\n// creates a new IFileSystem, with path mappings into the wine prefix\nIFileSystem wineFileSystem = prefix.CreateOverlayFileSystem(FileSystem.Shared);\n\n// this wineFileSystem can be used instead of FileSystem.Shared:\nvar handler = new OriginHandler(wineFileSystem);\n\n// you can also create a new IRegistry:\nIRegistry wineRegistry = prefix.CreateRegistry(FileSystem.Shared);\n\n// and use both:\nvar handler = new EGSHandler(wineRegistry, wineFileSystem);\n```\n\n### Default Prefix Manager\n\n`GameFinder.Wine` implements a `IWinePrefixManager` for finding Wine prefixes.\n\n**Usage**:\n\n```csharp\nvar prefixManager = new DefaultWinePrefixManager(FileSystem.Shared);\n\nforeach (var result in prefixManager.FindPrefixes())\n{\n    result.Switch(prefix =\u003e\n    {\n        Console.WriteLine($\"Found wine prefix at {prefix.ConfigurationDirectory}\");\n    }, error =\u003e\n    {\n        Console.WriteLine(error.Value);\n    });\n}\n```\n\n### Bottles\n\n`GameFinder.Wine` implements a `IWinePrefixManager` for finding Wine prefixes managed by [Bottles](https://usebottles.com/).\n\n**Usage**:\n\n```csharp\nvar prefixManager = new BottlesWinePrefixManager(FileSystem.Shared);\n\nforeach (var result in prefixManager.FindPrefixes())\n{\n    result.Switch(prefix =\u003e\n    {\n        Console.WriteLine($\"Found wine prefix at {prefix.ConfigurationDirectory}\");\n    }, error =\u003e\n    {\n        Console.WriteLine(error.Value);\n    });\n}\n```\n\n### Proton\n\nValve's [Proton](https://github.com/ValveSoftware/Proton) is a compatibility tool for Steam and is mostly based on Wine. The Wine prefixes managed by Proton are in the `compatdata` directory of the steam library where the game itself is installed. Since the path is relative to the game itself and requires the app id, I've decided to put this functionality in `GameFinder.StoreHandlers.Steam`:\n\n```csharp\nSteamGame? steamGame = steamHandler.FindOneGameById(1237970, out var errors);\nif (steamGame is null) return;\n\nProtonWinePrefix protonPrefix = steamGame.GetProtonPrefix();\nvar protonPrefixDirectory = protonPrefix.ProtonDirectory;\n\nif (protonDirectory != default \u0026\u0026 fileSystem.DirectoryExists(protonDirectory))\n{\n    Console.WriteLine($\"Proton prefix is at {protonDirectory}\");\n}\n```\n\n## Trimming\n\nSelf-contained deployments and executables can be [trimmed](https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained) starting with .NET 6. This feature is _only_ available to applications that are published self-contained.\n\n**Trimmable**:\n\n- `GameFinder.Common`\n- `GameFinder.RegistryUtils`\n- `GameFinder.Wine`\n- `GameFinder.StoreHandlers.Steam`\n- `GameFinder.StoreHandlers.GOG`\n- `GameFinder.StoreHandlers.EGS`\n- `GameFinder.StoreHandlers.Origin`\n\n**NOT Trimmable**:\n\n- `GameFinder.StoreHandlers.EADesktop`: This package references `System.Management`, which is **not trimmable** due to COM interop issues. See [dotnet/runtime#78038](https://github.com/dotnet/runtime/issues/78038), [dotnet/runtime#75176](https://github.com/dotnet/runtime/pull/75176) and [dotnet/runtime#61960](https://github.com/dotnet/runtime/issues/61960) for more details.\n\nI recommend looking at the [project file](./other/GameFinder.Example/GameFinder.Example.csproj) of the example project, if you run into warnings or errors with trimming.\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md) for more information.\n\n## License\n\nSee [LICENSE](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferri120%2Fgamefinder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferri120%2Fgamefinder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferri120%2Fgamefinder/lists"}