GOG Galaxy plugin for GameLib.NET.
The plugin will deliver information about the installation status of the GOG Galaxy
launcher as well the installed games within the launcher.
The plugin is already bundled with the core library GameLib.NET
To get the additonal information this plugin is providing just cast IGame
to GogGame
.
using GameLib;
using GameLib.Plugin.Gog;
using GameLib.Plugin.Gog.Model;
var launcherManager = new LauncherManager();
// not required to cast here just to add to the documentation
var launcher = (GogLauncher?)launcherManager.GetLaunchers()
.Where(launcher => launcher.Name == "GOG Galaxy")
// Plugin ID could also be used instead of the name
//.Where(launcher => launcher.Id == new Guid("54C9D299-107E-4990-894D-9DB402F81CA3"))
.FirstOrDefault();
if (launcher is not null)
{
var games = (IEnumerable<GogGame>)launcher.Games;
foreach (var game in games)
{
// Write additional data GOG Galaxy is providing for a game besides from the IGame interface
Console.WriteLine($"\nGame");
Console.WriteLine($"\tBuildId: {game.BuildId}");
Console.WriteLine($"\tDependsOn: {game.DependsOn}");
Console.WriteLine($"\tDlc: {game.Dlc}");
Console.WriteLine($"\tInstallerLanguage: {game.InstallerLanguage}");
Console.WriteLine($"\tLangCode: {game.LangCode}");
Console.WriteLine($"\tLanguage: {game.Language}");
Console.WriteLine($"\tLaunchCommand: {game.LaunchCommand}");
Console.WriteLine($"\tLaunchParam: {game.LaunchParam}");
Console.WriteLine($"\tPath: {game.Path}");
Console.WriteLine($"\tProductId: {game.ProductId}");
Console.WriteLine($"\tStartMenu: {game.StartMenu}");
Console.WriteLine($"\tStartMenuLink: {game.StartMenuLink}");
Console.WriteLine($"\tSupportLink: {game.SupportLink}");
Console.WriteLine($"\tUninstallCommand: {game.UninstallCommand}");
Console.WriteLine($"\tVersion: {game.Version}");
}
}