steamlocate
A crate which efficiently locates any Steam application on the filesystem, and/or the Steam installation itself.
This crate is best used when you do not want to depend on the Steamworks API for your program. In some cases the Steamworks API may be more appropriate to use, in which case I recommend the fantastic steamworks crate. You don't need to be a Steamworks partner to get installation directory locations from the Steamworks API.
This crate supports Windows, macOS and Linux.
Using steamlocate
Simply add to your Cargo.toml file:
[]
= "0.*"
To use steamid-ng with steamlocate, add this to your Cargo.toml file:
[]
= "1.*"
[]
= "0.*"
= ["steamid_ng"]
Caching
All functions in this crate cache their results, meaning you can call them as many times as you like and they will always return the same reference.
If you need to get uncached results, simply instantiate a new SteamDir.
steamid-ng Support
This crate supports steamid-ng and can automatically convert SteamApp::last_user to a SteamID for you.
To enable this support, use the steamid_ng
Cargo.toml feature.
Examples
Locate the installed Steam directory
extern crate steamlocate;
use SteamDir;
match locate
SteamDir
Locate an installed Steam app by its app ID
This will locate Garry's Mod anywhere on the filesystem.
extern crate steamlocate;
use SteamDir;
let mut steamdir = locate.unwrap;
match steamdir.app
SteamApp
Locate all Steam apps on this filesystem
extern crate steamlocate;
use ;
use HashMap;
let mut steamdir = locate.unwrap;
let apps: & = steamdir.apps;
println!;
Locate all Steam library folders
extern crate steamlocate;
use ;
use ;
let mut steamdir: SteamDir = locate.unwrap;
let libraryfolders: &LibraryFolders = steamdir.libraryfolders;
let paths: & = &libraryfolders.paths;
println!;
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be dual licensed as above, without any additional terms or conditions.