GameLib.NET 1.3.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package GameLib.NET --version 1.3.3                
NuGet\Install-Package GameLib.NET -Version 1.3.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GameLib.NET" Version="1.3.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GameLib.NET --version 1.3.3                
#r "nuget: GameLib.NET, 1.3.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GameLib.NET as a Cake Addin
#addin nuget:?package=GameLib.NET&version=1.3.3

// Install GameLib.NET as a Cake Tool
#tool nuget:?package=GameLib.NET&version=1.3.3                

GameLib.NET GameLib.NET

GameLib.NET is a library to give .NET developers easy access to the users installed game launchers and installed games. The motivation for the library is a tool I'm currently working on which requires access to all game executables on a PC.

While this repository is providing already the plugins to gather the games from the most popular game launchers, it easily extendible via the MEF Framework. A developer guide will follow, but I'm pretty sure the geeks will find out themselfes on how to do it.

Following plugins are already bundled with GameLib.NET to detect the game launchers including their installed games:

Installing

Multiple options are available to install within your project:

  1. Install, using the Nuget Gallery

  2. Install using the Package Manager Console:

    Install-Package GameLib.NET 
    
  3. Install using .NET CLI

    dotnet add package GameLib.NET
    

Usage

GameLib.NET provides a LauncherManager class which has to be instantiated, optionally LauncherOptions can be supplied. Each Plugin will provide an interface instance for the launcher ILauncher as well an interface instance for IEnumerable<Game>.

using GameLib;

var launcherManager = new LauncherManager(new LauncherOptions() { QueryOnlineData = true });

foreach (var launcher in launcherManager.GetLaunchers())
{
    Console.WriteLine($"Launcher name: {launcher.Name}");
    Console.WriteLine("Games:");

    foreach (var game in launcher.Games)
    {
        Console.WriteLine($"Game ID: {game.GameId}");
        foreach (var item in game.GetType().GetProperties().Where(p => p.Name != "GameId"))
        {
            Console.WriteLine($"\t{item.Name}: {item.GetValue(game)}");
        }
    }
}

Please note: All values are cached within each launcher to save computing time on the next call. If you like to get refreshed values (e.g. new game installed while the lib is running) the Refresh() Method on the LauncherManager or on the actual ILauncher has to be called.

What launcher / game information is the library providing?

To make a long story short have a look at the ILauncher interface as well as the IGame interface to see what values are returned by default. Each plugin can provide more information, which can be found in the README.md the corresponding plugin.

Please note: Not all launchers will fill all properties in the IGame interface instance. Further information are provided in the README.md of each plugin.

Demo application

Have a look at the Console Demo as well as the WPF GUI Demo within the repository. Both will run straight out of the box to give you a hint what the library can do for you.

WPF GUI Demo Launchers Screenshot

WPF GUI Demo Games Screenshot

Support

I try to be responsive to Stack Overflow questions in the gamelib-net tag and issues logged on this GitHub repository.

If I've helped you, feel free to buy me a coffee or see the Sponsor link at the top right of the GitHub page.

<a href="https://www.buymeacoffee.com/tekgator" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>

Dependencies and Credits

Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on GameLib.NET:

Repository Stars
project-sbc/Handheld-Control-Panel
Version Downloads Last updated
1.4.1 1,643 7/30/2023
1.3.3 1,694 3/18/2023
1.3.2 1,656 9/16/2022
1.3.1 1,663 9/11/2022
1.3.0 1,621 9/11/2022
1.2.1 1,658 9/4/2022
1.1.2 1,623 9/1/2022
1.1.1 1,628 8/27/2022
1.0.6 1,589 8/24/2022
1.0.5 1,599 8/13/2022
1.0.4 1,605 8/12/2022
1.0.3 1,558 8/10/2022
1.0.2 1,668 7/10/2022

# Changelog
All notable changes to this project will be documented in this file.

## [Unreleased]

## [1.3.3] - 2023-03-18
### Fixed
- Reading all executables in a directory crashed if directory doesn't exists


## [1.3.2] - 2022-09-16
### Added
- Add LauncherOption to also search for additional executables within a game install directory
- Add Executables property to IGame interface to list all additional executables within a game install directory

### Fixed
- Steam plugin was not processing manifest entries in parallel


## [1.3.1] - 2022-09-11
### Fixed
- Activate parallel processing of installed games for Battle.net and Rockstar Games

### Deleted
- Remove "ExecutablePath" from ILauncher interface
- Remove "ExecutablePath" from IGame interface

### Changed
- "Executable" on ILauncher interface returns the executable including the path
- "Executable" on IGame interface returns the executable including the path


## [1.3.0] - 2022-09-11
### Added
- Add Rockstar Games plugin for interacting with Rockstar Games launcher and games
- If Launcher cannot provide executable add option to search Windows GameConfigStore for the game executable


## [1.2.1] - 2022-09-04
### Fixed
- Mark BattleNet Plugin as private asset so it is not a dependency


## [1.2.0] - 2022-09-04
### Added
- Add Battle.net plugin for interacting with Battle.net launcher and games


## [1.1.2] - 2022-09-01
### Added
- Add ExecutableIcon property on IGame interface / implementations
- Add ExecutableIcon property on ILauncher interface / implementations
- Add WPF GUI demo application


## [1.1.1] - 2022-08-27
### Fixed
- Refresh caused an dead lock in UI applications due to incorrect async call
- Refresh on LauncherManager also returns the Launchers collection so no extra GetLaunchers call need to be made


## [1.1.0] - 2022-08-27
### Fixed
- disable 0649 to avoid compiler warning for MEF variables

### Added
- Add LauncherOptions to ILauncher interface to change settings on the fly for a single plugin
- Add Documentation to LauncherOptions
- Add Documentation to LauncherManager methods

### Changed
- Corrected Plugin documentation concerning referencing the Plugin ID
- Restructure of code
- Rename ClearCache method on LauncherManager and ILauncher Interface to Refresh
- LauncherManager will now always refresh all Plugins including the Games on initial GetLauncher call
- Remove GetGames method on ILauncher interface and instead add Games property


## [1.0.6] - 2022-08-24
### Fixed
- Origin plugin did not return working directory and executable name for online queries

### Changed
- Launchers property replaced with GetLaunchers method on LauncherManager as a property should not be an expensive call. As on first call the plugins are loaded the property can be executing for a bit depending on the system.


## [1.0.5] - 2022-08-13
### Added
- Add ID property on ILauncher interface
- Add Launcher ID property on IGame interface in order to know what launcher the game belongs to

### Changed
- Rename LargeLogo property to Logo on ILauncher interface
- Simplify console demo by writing every property of the ILauncher interface

### Deleted
- Remove SmallLogo property on ILauncher interface


## [1.0.4] - 2022-08-12
### Added
- Add LargeLogo property on ILauncher interface

### Changed
- Rename Icon property to SmallLogo on ILauncher interface


## [1.0.3] - 2022-08-10
### Added
- Changelog file
- Add changelog file to Nuget
- 32px game launcher icons
- Provide Icon property on ILauncher interface

### Changed
- Restructioring of the project by removing SRC folder
- Demo executable icon is loaded from Ressource folder instead of keeping it with the project
- Add game launcher icons to ReadMe
- Rearrange resource files from solution into plugin resource folders


## [1.0.2] - 2022-07-10
### Added
- Add reference to Teronis.DotNet to be able to add project reference content to be added to the NuGet-package during pack process

### Changed
- Plugins will not create own Nuget anymore
- Plugins are now bundled with the core library


## [1.0.1] - 2022-07-10
### Added
- Add automatic version for Nuget publishing process


## [1.0.0] - 2022-06-10
### Added
- Add automtic creation of Nuget


## [0.9.0] - 2022-05-10
### Added
- First working version



This project is MIT Licensed // Created & maintained by Patrick Weiss