Class GameFolderLocator
Namespace: ValveResourceFormat.IO
Assembly: ValveResourceFormat.dll
Provides methods for locating Steam game installations and libraries.
public static class GameFolderLocatorInheritance
object ← GameFolderLocator
Fields
SteamAppPathPrefix
Prefix of portable paths relative to the installation folder of a Steam app, such as steam:730/game/csgo/pak01_dir.vpk.
public const string SteamAppPathPrefix = "steam:"Field Value
string
Properties
SteamPath
Path to the root of Steam installation. null if not found.
public static string? SteamPath { get; }Property Value
string?
Methods
FindAllSteamGames()
Find all installed games in all Steam library folders.
public static List<GameFolderLocator.SteamLibraryGameInfo> FindAllSteamGames()Returns
List<GameFolderLocator.SteamLibraryGameInfo>
A list of all installed Steam games.
FindSteamGameByAppId(int)
Optimized way to find Steam game by app id. Opens only 1 file for the specified app, instead of opening new file for every installed game.
public static GameFolderLocator.SteamLibraryGameInfo? FindSteamGameByAppId(int appId)Parameters
appId int
Returns
GameFolderLocator.SteamLibraryGameInfo?
FindSteamGameContainingPath(string, IEnumerable<SteamLibraryGameInfo>)
Finds the installed Steam app whose installation folder contains the path.
public static GameFolderLocator.SteamLibraryGameInfo? FindSteamGameContainingPath(string fullPath, IEnumerable<GameFolderLocator.SteamLibraryGameInfo> games)Parameters
fullPath string
Full path to a file or folder.
games IEnumerable<GameFolderLocator.SteamLibraryGameInfo>
Installed apps, as returned by GameFolderLocator.FindAllSteamGames().
Returns
GameFolderLocator.SteamLibraryGameInfo?
The app, the one with the lowest app id if several share the folder, or null.
FindSteamLibraryFolderPaths()
Find all the Steam installation library paths.
public static List<string> FindSteamLibraryFolderPaths()Returns
List<string>
A list of Steam library paths.
GetSteamAppPath(string, IReadOnlyList<SteamLibraryGameInfo>?)
Converts a full path inside of an installed Steam app to a portable steam:<appid>/<path> path, which resolves back to the same file on any computer that has the app installed.
public static string? GetSteamAppPath(string fullPath, IReadOnlyList<GameFolderLocator.SteamLibraryGameInfo>? games = null)Parameters
fullPath string
Path to convert.
games IReadOnlyList<GameFolderLocator.SteamLibraryGameInfo>?
Installed apps, as returned by GameFolderLocator.FindAllSteamGames(). Found when not given.
Returns
string?
The portable path, or null if the path is not inside of an installed app.
IsSteamAppPath(string)
Whether the path is relative to a Steam app, see GameFolderLocator.SteamAppPathPrefix.
public static bool IsSteamAppPath(string path)Parameters
path string
Returns
bool
TryResolveSteamAppPath(string, out string, out string?)
Resolves a steam:<appid>/<path> path to the full path inside of the installation folder of that Steam app, other paths are returned unchanged.
public static bool TryResolveSteamAppPath(string path, out string resolvedPath, out string? error)Parameters
path string
Path to resolve.
resolvedPath string
The resolved path, or path if it is not relative to a Steam app or could not be resolved.
error string?
Why the path could not be resolved, such as the app not being installed.
Returns
bool

