| Crates.io | libprotonup |
| lib.rs | libprotonup |
| version | 0.9.3 |
| created_at | 2022-11-14 04:17:52.164407+00 |
| updated_at | 2025-12-29 20:16:16.301395+00 |
| description | Library for Custom Proton Download and installation |
| homepage | |
| repository | https://github.com/auyer/protonup-rs |
| max_upload_size | |
| id | 714691 |
| size | 104,781 |
ProtonUp-rs is a tool for managing compatibility tools (like Proton, WineGE) for apps like Steam and Lutris. It handles downloading, verifying, and installing tools from GitHub repositories.
apps Module)App EnumRepresents supported applications:
pub enum App {
Steam,
Lutris,
Custom(String) // User-provided path
}
default_compatibility_tool(): Returns default tool (e.g., GEProton for Steam)detect_installation_method(): Checks for Native/Flatpak installationssubfolder_for_tool(): Gets tool-specific subfolder (e.g., "runners/wine" for Lutris Wine tools)AppInstallations EnumTracks installation variants:
pub enum AppInstallations {
Steam, SteamFlatpak,
Lutris, LutrisFlatpak,
Custom(String)
}
installation_dir(): Builds full path for tool installation
list_installed_versions(): Lists installed tool versions
app_base_dir(): Returns root directory (e.g., ~/.steam/steam)
Adding support to new tools should be a simple process. If it has a default installation folder, the existing methods should work to detect it.
sources Module)CompatTool StructDefines compatibility tool sources:
pub struct CompatTool {
pub name: String, // e.g., "GEProton"
pub forge: Forge, // Source (GitHub)
pub repository_account: String, // "GloriousEggroll"
pub repository_name: String, // "proton-ge-custom"
pub tool_type: ToolType, // WineBased/Runtime
// ... other fields
}
installation_name(): Processes version strings (e.g., "v1.5" → "dxvk-1.5")filter_asset(): Matches release assets using regexPreconfigured Tools:
Adding new tools should be a simple process. All data related to them are stored in the sources.ron file.
Functionality like templating is optional, and not necessary for all tools.
downloads Module)Release Structpub struct Release {
pub tag_name: String, // Version tag
pub assets: Vec<Asset> // Downloadable files
}
get_download_info(): Creates Download object with URLs and hashesDownload Structpub struct Download {
pub file_name: String,
pub download_url: String,
pub hash_sum: Option<HashSums>, // SHA256/512
// ... other fields
}
Key Functions:
list_releases(): Fetches GitHub releasesdownload_to_async_write(): Downloads with progress trackingfiles Module)Key Features:
Decompression: Supports .tar.gz, .tar.xz, .tar.zst
Directory Management:
async fn list_folders_in_path(path: &PathBuf) -> Result<Vec<String>>
async fn remove_dir_all(path: &PathBuf) -> Result<()>
Installation:
async fn unpack_file(reader: impl AsyncRead, install_path: &Path)
hashing Module)Hash Verification:
pub async fn hash_check_file(
file_name: &str,
file: &mut impl AsyncRead,
git_hash: HashSums
) -> Result<bool>
utils::expand_tilde("~/.steam") // => "/home/user/.steam"
pub const DEFAULT_STEAM_TOOL: &str = "GEProton";
pub const DEFAULT_LUTRIS_TOOL: &str = "WineGE";
pub const USER_AGENT: &str = "protoup-rs/vX.Y.Z";
Detect Installed Apps:
let installed = list_installed_apps().await;
// e.g., [AppInstallations::Steam]
Fetch Releases:
let releases = list_releases(&compat_tool).await?;
Download & Verify:
download_to_async_write(&url, &mut file).await?;
hash_check_file(file_name, &mut file, expected_hash).await?;
Install:
unpack_file(reader, install_path).await?;