Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Though upstream [GameFinder](https://github.com/erri120/GameFinder) adheres to [

**WIP**:

- Add [PkgHandlers](https://github.com/Nutzzz/GameCollector/pull/40) to find installed software, and to download free games
- Add [DataHandlers](https://github.com/Nutzzz/GameCollector/pull/13) to download metadata and images from online sources

## [Released](https://github.com/Nutzzz/GameCollector/releases)
Expand All @@ -26,6 +25,7 @@ Though upstream [GameFinder](https://github.com/erri120/GameFinder) adheres to [
## Added

- Upstream: Heroic (GOG): Support Linux native games
- Add Winget package handler to detect installed apps and free game packages

## [4.4.0-1](https://github.com/erri120/GameFinder/compare/v4.3.2.1...v4.4.0.1) - 2024-12-11

Expand All @@ -34,6 +34,8 @@ Though upstream [GameFinder](https://github.com/erri120/GameFinder) adheres to [
- Upstream: GOG & Heroic (GOG): Add `BuildId`
- Steam: Check for empty manifest file

## [4.3.3-1](https://github.com/Nutzzz/GameCollector/compare/v4.3.2.1...v4.3.3.1) - 2024-10-09

### Fixed

- Upstream: Wine: `users` instead of `Users`
Expand Down
7 changes: 6 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<VersionPrefix>4.5.0</VersionPrefix>
<Authors>Nutzzz, erri120</Authors>
Expand All @@ -10,6 +9,12 @@
<RepositoryUrl>https://github.com/Nutzzz/GameCollector.git</RepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)' == 'x64'">
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)' == 'AnyCPU'">
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<!-- https://github.com/dotnet/sourcelink/tree/main/docs#continuousintegrationbuild -->
Expand Down
5 changes: 5 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<PackageVersion Include="HtmlAgilityPack" Version="1.11.72" />
<PackageVersion Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
<PackageVersion Include="Microsoft.Management.Deployment" Version="8.0.0" />
<PackageVersion Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.183" />
<PackageVersion Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.9.25180" />
<PackageVersion Include="Microsoft.WindowsPackageManager.InProcCom" Version="1.9.25180" />
<PackageVersion Include="protobuf-net" Version="3.2.46" />
<PackageVersion Include="SteamWebAPI2" Version="4.4.1" />
<PackageVersion Include="System.Data.SQLite" Version="1.0.119" />
Expand Down
317 changes: 257 additions & 60 deletions GameCollector.sln

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.NET library for finding games. GameCollector expands on upstream GameFinder (which is primarily designed to support modding tools), by adding additional supported store launchers, emulators, and data sources, and includes additional information about each game (sufficient for a multi-store game launcher such as [GLC](https://github.com/Solaire/GLC)). This fork is indebted to erri120's hard work, but as [he is reticent](https://github.com/erri120/GameFinder/issues/49) to expand the scope of GameFinder, GameCollector continues with a different philosophy.

The following launchers and emulators are supported:
The following launchers, emulators, and package managers are supported:

| handler | package |
| -- | -- |
Expand Down Expand Up @@ -36,6 +36,7 @@ The following launchers and emulators are supported:
| [Steam](#steam) | [![Nuget](https://img.shields.io/nuget/v/GameCollector.StoreHandlers.Steam)](https://www.nuget.org/packages/GameCollector.StoreHandlers.Steam) [![Nuget](https://img.shields.io/nuget/v/GameFinder.StoreHandlers.Steam?color=red&label=upstream)](https://www.nuget.org/packages/GameFinder.StoreHandlers.Steam) |
| Ubisoft Connect | [![Nuget](https://img.shields.io/nuget/v/GameCollector.StoreHandlers.Ubisoft)](https://www.nuget.org/packages/GameCollector.StoreHandlers.Ubisoft) |
| Wargaming.net Game Center | [![Nuget](https://img.shields.io/nuget/v/GameCollector.StoreHandlers.WargamingNet)](https://www.nuget.org/packages/GameCollector.StoreHandlers.WargamingNet) |
| Windows Package Manager | [![Nuget](https://img.shields.io/nuget/v/GameCollector.PkgHandlers.Winget)](https://www.nuget.org/packages/GameCollector.PkgHandlers.Winget) |
| [Xbox Game Pass](#xbox-game-pass) | [![Nuget](https://img.shields.io/nuget/v/GameCollector.StoreHandlers.Xbox)](https://www.nuget.org/packages/GameCollector.StoreHandlers.Xbox) [![Nuget](https://img.shields.io/nuget/v/GameFinder.StoreHandlers.Xbox?color=red&label=upstream)](https://www.nuget.org/packages/GameFinder.StoreHandlers.Xbox) |

If you are interested in understanding _how_ GameCollector/GameFinder finds these games, check [the upstream wiki](https://github.com/erri120/GameFinder/wiki) for more information (descriptions of the added handlers should eventually be added to a wiki here).
Expand Down Expand Up @@ -98,6 +99,12 @@ The TGame implementations of GameCollector's handlers inherit a generic GameData

The Metadata dictionary may include (depending on available information): "ReleaseDate", "Description", "Developers", "Publishers", "Genres", "ImageUrl", etc.

### Supported Package Managers

This is a new category of handler for GameCollector. It is Windows-only for now.

- Winget

### Supported Emulators

This is a new category of handler for GameCollector. They are Windows-only for now.
Expand Down Expand Up @@ -418,7 +425,7 @@ Self-contained deployments and executables can be [trimmed](https://learn.micros

**NOT Trimmable**:

- `GameCollector.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.
- `GameCollector.StoreHandlers.EADesktop` and `GameCollector.PkgHandlers.Winget`: These packages reference `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.

I 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.

Expand Down
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ component_management:
name: Wargaming.net Game Center
paths:
- "src/GameCollector.StoreHandlers.WargamingNet/**"
- component_id: pkg_handler_winget
name: Windows Package Manager
paths:
- "src/GameCollector.PkgHandlers.Winget/**"
- component_id: emu_handler_dolphin
name: Dolphin Emulator
paths:
Expand Down
3 changes: 3 additions & 0 deletions other/GameFinder.Benchmarks/GameFinder.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
</ItemGroup>
Expand Down
22 changes: 19 additions & 3 deletions other/GameFinder.Example/GameFinder.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,29 @@
<PublishUrl>publish\</PublishUrl>
<UserSecretsId>2f3f5c05-f8b8-4435-901e-1caec9ff8715</UserSecretsId>
<ApplicationIcon>..\..\GameCollector.ico</ApplicationIcon>
<StartupObject>GameCollector.Program</StartupObject>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)' == 'x64'">
<PlatformTarget>x64</PlatformTarget>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<DefineConstants>WINX64</DefineConstants>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)' == 'AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\GameFinder.Launcher.Heroic\GameFinder.Launcher.Heroic.csproj" />
<ProjectReference Include="..\..\src\GameFinder.StoreHandlers.EGS\GameFinder.StoreHandlers.EGS.csproj" />
<ProjectReference Include="..\..\src\GameFinder.StoreHandlers.EGS\GameFinder.StoreHandlers.EGS.csproj" />
<ProjectReference Include="..\..\src\GameFinder.StoreHandlers.GOG\GameFinder.StoreHandlers.GOG.csproj" />
<ProjectReference Include="..\..\src\GameFinder.StoreHandlers.Origin\GameFinder.StoreHandlers.Origin.csproj" />
<ProjectReference Include="..\..\src\GameFinder.StoreHandlers.Steam\GameFinder.StoreHandlers.Steam.csproj" />
<ProjectReference Include="..\..\src\GameFinder.StoreHandlers.Xbox\GameFinder.StoreHandlers.Xbox.csproj" />
<ProjectReference Include="..\..\src\GameFinder.Wine\GameFinder.Wine.csproj" />
</ItemGroup>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\GameFinder.StoreHandlers.EADesktop\GameFinder.StoreHandlers.EADesktop.csproj" />
Expand Down Expand Up @@ -52,6 +64,10 @@
<ProjectReference Include="..\..\src\GameCollector.EmuHandlers.MAME\GameCollector.EmuHandlers.MAME.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(Platform)' == 'x64'">
<ProjectReference Include="..\..\src\GameCollector.PkgHandlers.Winget\GameCollector.PkgHandlers.Winget.csproj" />
</ItemGroup>

<ItemGroup>
<!--<ProjectReference Include="..\..\src\GameCollector.DataHandlers.TheGamesDb\GameCollector.DataHandlers.TheGamesDb.csproj" />-->
</ItemGroup>
Expand Down
37 changes: 26 additions & 11 deletions other/GameFinder.Example/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ public class Options
[Option("gog", HelpText = "Search for GOG GALAXY games", Hidden = true, Group = "Handlers")]
public bool GOG { get; set; } = false;

[Option("heroic", HelpText = "Search for games from Heroic", Hidden = true, Group = "Handlers")]
public bool Heroic { get; set; } = false;

[Option("humble", HelpText = "Search for Humble App games", Hidden = true, Group = "Handlers")]
public bool Humble { get; set; } = false;

Expand Down Expand Up @@ -96,10 +93,8 @@ public class Options
[Option("steam", HelpText = "Search for Steam games", Hidden = true, Group = "Handlers")]
public bool Steam { get; set; } = false;

/*
[Option("tgdb", HelpText = "Search for TheGamesDb.net games", Group = "Handlers")]
[Option("tgdb", HelpText = "Search for TheGamesDb.net games", Hidden = true, Group = "Handlers")]
public bool TheGamesDB { get; set; } = false;
*/

// alias for "ubisoft"
[Option("uplay", HelpText = "Search for Ubisoft Connect games", Hidden = true)]
Expand All @@ -115,21 +110,41 @@ public class Options
[Option("wargaming", HelpText = "Search for Wargaming.Net Game Center games", Hidden = true, Group = "Handlers")]
public bool Wargaming { get; set; } = false;

#if WINX64
[Option("winget", HelpText = "Search for Windows Package Manager packages", Hidden = false, Group = "Handlers")]
#else
[Option("winget", HelpText = "Search for Windows Package Manager packages", Hidden = true, Group = "Handlers")]
#endif
public bool Winget { get; set; } = false;

[Option("xbox", HelpText = "Search for Xbox Games Pass games", Hidden = true, Group = "Handlers")]
public bool Xbox { get; set; } = false;

[Option('s', "steamapi", HelpText = "Specify Steam API key from <https://steamcommunity.com/dev/apikey> (optional)", MetaValue = "KEY")]
public string? SteamAPI { get; set; }

/*
[Option('t', "tgdbapi", HelpText = "Specify TheGamesDb.net API key from <https://api.thegamesdb.net/key.php> (optional)", MetaValue = "KEY")]
[Option('t', "tgdbapi", HelpText = "Specify TheGamesDb.net API key from <https://api.thegamesdb.net/key.php> (optional)", Hidden = true, MetaValue = "KEY")]
public string? TheGamesDBAPI { get; set; }
*/

[Option('w', "wine", HelpText = "Search for Wine prefixes")]
#if WINX64
[Option("heroic", HelpText = "Search for games from Heroic", Hidden = true)]
#else
[Option("heroic", HelpText = "Search for games from Heroic", Hidden = false)]
#endif
public bool Heroic { get; set; } = false;

#if WINX64
[Option('w', "wine", HelpText = "Search for Wine prefixes", Hidden = true)]
#else
[Option('w', "wine", HelpText = "Search for Wine prefixes", Hidden = false)]
#endif
public bool Wine { get; set; } = false;

[Option('b', "bottles", HelpText = "Search for Wine prefixes managed with Bottles")]
#if WINX64
[Option('b', "bottles", HelpText = "Search for Wine prefixes managed with Bottles", Hidden = true)]
#else
[Option('b', "bottles", HelpText = "Search for Wine prefixes managed with Bottles", Hidden = false)]
#endif
public bool Bottles { get; set; } = false;

[Option('i', "installed", HelpText = "Only retrieve installed games")]
Expand Down
44 changes: 34 additions & 10 deletions other/GameFinder.Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
using GameCollector.StoreHandlers.Rockstar;
using GameCollector.StoreHandlers.Ubisoft;
using GameCollector.StoreHandlers.WargamingNet;
#if WINX64
using GameCollector.PkgHandlers.Winget;
#endif
using GameCollector.EmuHandlers.Dolphin;
using GameCollector.EmuHandlers.MAME;
//using GameCollector.DataHandlers.TheGamesDb;
Expand All @@ -51,7 +54,6 @@
using IFileSystem = NexusMods.Paths.IFileSystem;
using ILogger = Microsoft.Extensions.Logging.ILogger;

[assembly: ExcludeFromCodeCoverage]
namespace GameCollector;

public static class Program
Expand Down Expand Up @@ -115,23 +117,22 @@ private async static void Run(Options options, ILogger logger)

var settings = new Settings(options.Installed, options.Parent || options.Base, options.Owned, options.Games);

if (options.All) // Enable all emulator and handlers
if (options.All) // Enable all handlers
{
options.Amazon = true;
options.Arc = true;
options.BattleNet = true;
options.BigFish = true;
//options.Dolphin ??= "";
//options.Dolphin ??= ""; // needs path
options.EA = true;
options.Epic = true;
options.GameJolt = true;
options.GOG = true;
options.Heroic = true;
options.Humble = true;
options.IG = true;
options.Itch = true;
options.Legacy = true;
//options.MAME ??= "";
//options.MAME ??= ""; // needs path
options.Oculus = true;
options.Origin = true;
options.Paradox = true;
Expand All @@ -140,10 +141,16 @@ private async static void Run(Options options, ILogger logger)
options.RobotCache = true;
options.Rockstar = true;
options.Steam = true;
//options.TheGamesDB = true;
options.TheGamesDB = false; // WIP
options.Ubisoft = true;
options.Wargaming = true;
options.Xbox = true;
#if WINX64
options.Winget = OperatingSystem.IsWindows(); // Requires TargetFramework net8.0-windows10.0.19041.0
#else
options.Heroic = OperatingSystem.IsLinux();
options.Wine = OperatingSystem.IsLinux();
#endif
}

if (OperatingSystem.IsWindows())
Expand Down Expand Up @@ -186,7 +193,9 @@ private async static void Run(Options options, ILogger logger)
if (options.Rockstar) tasks.Add(Task.Run(() => RunRockstarHandler(settings, windowsRegistry, realFileSystem), cancelToken));
if (options.Ubisoft || options.Uplay) tasks.Add(Task.Run(() => RunUbisoftHandler(settings, windowsRegistry, realFileSystem), cancelToken));
if (options.Wargaming || options.WargamingNet) tasks.Add(Task.Run(() => RunWargamingNetHandler(settings, windowsRegistry, realFileSystem), cancelToken));

#if WINX64
if (options.Winget) RunWingetHandler(settings, windowsRegistry, realFileSystem); //tasks.Add(Task.Run(() => RunWingetHandler(settings, windowsRegistry, realFileSystem), cancelToken));
#endif
if (options.Dolphin is not null)
{
tasks.Add(Task.Run(() =>
Expand Down Expand Up @@ -456,6 +465,20 @@ private static void RunWargamingNetHandler(Settings settings, IRegistry registry
LogGamesAndErrors(handler.FindAllGames(settings), logger);
}

#if WINX64
private static void RunWingetHandler(Settings settings, IRegistry registry, IFileSystem fileSystem)
{
var logger = _provider.CreateLogger(nameof(WingetHandler));
if (OperatingSystem.IsWindows())
{
var handler = new WingetHandler(registry, fileSystem, logger); //, logger);
LogGamesAndErrors(handler.FindAllGames(settings), logger);
}
else
logger.LogError("Handler requires Windows-only target.");
}
#endif

private static void RunDolphinHandler(Settings settings, IRegistry registry, IFileSystem fileSystem, AbsolutePath path)
{
var logger = _provider.CreateLogger(nameof(DolphinHandler));
Expand All @@ -470,15 +493,16 @@ private static void RunMAMEHandler(Settings settings, IFileSystem fileSystem, Ab
LogGamesAndErrors(handler.FindAllGames(settings), logger);
}

/*
private static async void RunTheGamesDbHandler(IFileSystem fileSystem, string? tgdbApi, Settings settings)
{
var logger = _provider.CreateLogger(nameof(TheGamesDbHandler));
var logger = _provider.CreateLogger("TheGamesDbHandler");
logger.LogError("Handler not yet implemented.");
/*
//var handler = new TheGamesDbHandler(fileSystem, tgdbApi, registry: null, logger);
var handler = new TheGamesDbHandler(fileSystem, registry: null, logger);
LogGamesAndErrors(handler.FindAllGames(settings), logger);
*/
}
*/

private static List<AWinePrefix> LogWinePrefixes<TWinePrefix>(IWinePrefixManager<TWinePrefix> prefixManager, ILogger logger)
where TWinePrefix : AWinePrefix
Expand Down
4 changes: 4 additions & 0 deletions src/GameCollector.Common/GameCollector.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="GameFinder.Common.Tests" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<Description>Library for finding Dolphin ROMs.</Description>
<PackageTags>dolphin dolphin-emu emulator games</PackageTags>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<Description>Library for finding MAME ROMs.</Description>
<PackageTags>mame emulator games</PackageTags>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading