steamlocate
A crate which efficiently locates any Steam application on the filesystem, and/or the Steam installation itself.
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 Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.