[go: up one dir, main page]

FindSteamGame

FindSteamGame

FindSteamGame is an MSBuild task that detects the installation path of a Steam game (by AppId) and makes it available to your build pipeline. It works across Windows, macOS, and Linux, supporting both user and system-wide Steam installs.

This is ideal for mods or tooling that need to reference assemblies inside a game's directory (e.g., Assembly-CSharp.dll) without requiring users to manually configure the game path.

๐Ÿ’ก Especially useful for Unity games (with or without BepInEx).


Support The Project

If you find this project useful, and would like to see more, please consider supporting me on patreon.

Your support helps fund ongoing development, new features, other projects, and more. Every contribution is genuinely appreciated โ€” thank you!


๐Ÿ’พ Downloading Latest Release

Head over to Releases to download any version, or click the Latest Release button above for the latest version.

Each release includes:

  • FindSteamGame.zip โ€“ The core MSBuild task (FindSteamGame.dll), license, and a minimal Example.csproj.
  • example_csproj_files.zip โ€“ Example project files showing usage patterns.

๐Ÿ”ง Usage

1. Define configuration variables

SteamGameAppId is the game's Steam App ID (found on SteamDB), and FindSteamGameDLLDirectory should point to your local copy of FindSteamGame.dll.

<PropertyGroup>
   <SteamGameAppId>1017180</SteamGameAppId>
   <FindSteamGameDLLDirectory>$(MSBuildProjectDirectory)/FindSteamGame.dll</FindSteamGameDLLDirectory>
</PropertyGroup>

2. Reference the task in your .csproj or Directory.Build.targets

<UsingTask TaskName="FindSteamGameTask" AssemblyFile="$(FindSteamGameDLLDirectory)" />

3. Run the task before build to locate the Steam game install directory

<Target Name="FindSteamGamePath" BeforeTargets="PrepareForBuild" Condition="'$(SteamGamePath)' == '' and '$(SteamGameAppId)' != ''">
  <FindSteamGameTask AppId="$(SteamGameAppId)">
    <Output TaskParameter="GamePath" PropertyName="SteamGamePath" />
  </FindSteamGameTask>
  <Message Text=">> SteamGamePath: $(SteamGamePath)" Importance="High" />
</Target>

4. Use the resolved path for references

You can either:

  1. Reference DLLs directly
    <Target Name="ReferenceGameAssemblies" AfterTargets="FindSteamGamePath" Condition="'$(SteamGamePath)' != ''">
   <ItemGroup>
      <Reference Include="Assembly-CSharp">
         <HintPath>$(SteamGamePath)/TheLongDrive_Data/Managed/Assembly-CSharp.dll</HintPath>
         <Private>false</Private>
      </Reference>
      <Reference Include="TLDLoader">
         <HintPath>$(SteamGamePath)/TheLongDrive_Data/Managed/TLDLoader.dll</HintPath>
         <Private>false</Private>
      </Reference>
   </ItemGroup>
</Target>
  1. Or copy assemblies locally

See example_csproj_files.zip for .csproj setups that automatically copy game DLLs into a steamGamePathLibs/ folder and reference them.


โœ… Supported Platforms

  • Windows (registry + Program Files fallback)
  • macOS (user + system /Library path)
  • Linux (both ~/.steam/steam and system-wide installs)

๐Ÿ“ฆ What's Inside FindSteamGame.zip

  • FindSteamGame.dll โ€“ The compiled MSBuild task
  • LICENSE โ€“ The proprietary license for the tool (FindSteamGame.dll)
  • README.md โ€“ This document
  • Example.csproj - A minimal example that uses FindSteamGame.dll, but does not yet reference any game DLLs

๐Ÿ“ What's Inside example_csproj_files.zip

  • Multiple working .csproj examples:
    • Direct reference from game directory
    • Copy to steamGamePathLibs/ and reference locally
  • Fully public domain under The Unlicense

๐Ÿ’ก Notes

  • Compatible with both .NET Framework and .NET Standard MSBuild projects.
  • The SteamGamePath is available as a regular MSBuild property and can be used anywhere (copy targets, debug print, reference hints, etc.)

๐Ÿ“„ License

See the LICENSE files for licensing details

๐Ÿ“Œ Usage requirements (FindSteamGame.dll):

A copy of the license must be included in any repository using this DLL, placed alongside FindSteamGame.dll.

โš–๏ธ License TL;DR

FindSteamGame.dll is proprietary and not open source.

โœ… You may use it in software projects (such as mods, tools, or applications) and CI pipelines.

โœ… You may include it in your repository for development and build automation purposes.

โŒ You may not modify, reverse-engineer, or redistribute it as a standalone file.

โŒ You may not host, mirror, sell, or sublicense the DLL independently.

For licensing inquiries, email <wisheralpha@gmail.com>.

Full terms in the LICENSE file.

The example .csproj files are licensed under The UNLICENSE and are public domain. You are free to copy, use, modify, or otherwise adapt them as you need.