diff --git a/Cargo.lock b/Cargo.lock index 39575bb..f92eee9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,6 +36,7 @@ dependencies = [ "notify", "notify-rust", "progress_bar", + "rbxdd", "reqwest", "sdl2", "serde", @@ -115,7 +116,7 @@ dependencies = [ "polling 2.8.0", "rustix 0.37.23", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", ] @@ -317,9 +318,12 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.79" +version = "1.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -460,6 +464,36 @@ dependencies = [ "typenum", ] +[[package]] +name = "curl" +version = "0.4.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9fb4d13a1be2b58f14d60adba57c9834b78c62fd86c3e76a148f732686e9265" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2 0.5.7", + "windows-sys 0.52.0", +] + +[[package]] +name = "curl-sys" +version = "0.4.78+curl-8.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eec768341c5c7789611ae51cf6c459099f22e64a5d5d0ce4892434e33821eaf" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "windows-sys 0.52.0", +] + [[package]] name = "deranged" version = "0.3.11" @@ -913,7 +947,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1089,6 +1123,18 @@ dependencies = [ "redox_syscall 0.4.1", ] +[[package]] +name = "libz-sys" +version = "1.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -1583,6 +1629,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rbxdd" +version = "0.1.0" +source = "git+https://github.com/ApplejuiceHQ/rbxdd.git#c4301be73097277c6f09ccfc5ec9676ffb37b3c4" +dependencies = [ + "curl", + "serde_json", +] + [[package]] name = "redox_syscall" version = "0.3.5" @@ -1783,18 +1838,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -1803,11 +1858,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -1846,6 +1902,12 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -1874,6 +1936,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -2007,7 +2079,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2", + "socket2 0.4.9", "windows-sys 0.48.0", ] diff --git a/Cargo.toml b/Cargo.toml index 5bcbf3b..2521b16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ progress_bar = "1.0.5" reqwest = { version = "0.11.18", features = ["blocking"] } sdl2 = "0.35.2" serde = { version = "1.0.188", features = ["derive"] } -serde_json = "1.0.103" +serde_json = "1.0.132" sysinfo = "0.30.12" urlencoding = "2.1.3" +rbxdd = { git = "https://github.com/ApplejuiceHQ/rbxdd.git" } diff --git a/src/utils/installation.rs b/src/utils/installation.rs index 47984ec..c79bdf1 100644 --- a/src/utils/installation.rs +++ b/src/utils/installation.rs @@ -3,6 +3,7 @@ use std::process::exit; use std::{process, fs, path, io, thread, thread::available_parallelism}; use crate::utils::terminal::*; use crate::setup; +use rbxdd::{appsettings, bindings}; use serde::Deserialize; use serde_json::from_str; use reqwest::blocking::get; @@ -74,64 +75,6 @@ struct ResponseError { errors: Vec } -const PLAYER_EXTRACT_BINDINGS: [(&str, &str); 20] = [ - ("RobloxApp.zip", ""), - ("redist.zip", ""), - ("shaders.zip", "shaders/"), - ("ssl.zip", "ssl/"), - ("WebView2.zip", ""), - // ("WebView2RuntimeInstaller.zip", ""), (Unnecessary) - ("content-avatar.zip", "content/avatar/"), - ("content-configs.zip", "content/configs/"), - ("content-fonts.zip", "content/fonts/"), - ("content-sky.zip", "content/sky/"), - ("content-sounds.zip", "content/sounds/"), - ("content-textures2.zip", "content/textures/"), - ("content-models.zip", "content/models/"), - ("content-textures3.zip", "PlatformContent/pc/textures/"), - ("content-terrain.zip", "PlatformContent/pc/terrain/"), - ("content-platform-fonts.zip", "PlatformContent/pc/fonts/"), - ("extracontent-luapackages.zip", "ExtraContent/LuaPackages/"), - ("extracontent-translations.zip", "ExtraContent/translations/"), - ("extracontent-models.zip", "ExtraContent/models/"), - ("extracontent-textures.zip", "ExtraContent/textures/"), - ("extracontent-places.zip", "ExtraContent/places/") -]; -const STUDIO_EXTRACT_BINDINGS: [(&str, &str); 31] = [ - ("RobloxStudio.zip", ""), - ("redist.zip", ""), - ("Libraries.zip", ""), - ("LibrariesQt5.zip", ""), - ("WebView2.zip", ""), - // ("WebView2RuntimeInstaller.zip", ""), (Unnecessary) - ("shaders.zip", "shaders/"), - ("ssl.zip", "ssl/"), - ("Qml.zip", "Qml/"), - ("Plugins.zip", "Plugins/"), - ("StudioFonts.zip", "StudioFonts/"), - ("BuiltInPlugins.zip", "BuiltInPlugins/"), - ("ApplicationConfig.zip", "ApplicationConfig/"), - ("BuiltInStandalonePlugins.zip", "BuiltInStandalonePlugins/"), - ("content-qt_translations.zip", "content/qt_translations/"), - ("content-sky.zip", "content/sky/"), - ("content-fonts.zip", "content/fonts/"), - ("content-avatar.zip", "content/avatar/"), - ("content-models.zip", "content/models/"), - ("content-sounds.zip", "content/sounds/"), - ("content-configs.zip", "content/configs/"), - ("content-api-docs.zip", "content/api_docs/"), - ("content-textures2.zip", "content/textures/"), - ("content-studio_svg_textures.zip", "content/studio_svg_textures/"), - ("content-platform-fonts.zip", "PlatformContent/pc/fonts/"), - ("content-terrain.zip", "PlatformContent/pc/terrain/"), - ("content-textures3.zip", "PlatformContent/pc/textures/"), - ("extracontent-translations.zip", "ExtraContent/translations/"), - ("extracontent-luapackages.zip", "ExtraContent/LuaPackages/"), - ("extracontent-textures.zip", "ExtraContent/textures/"), - ("extracontent-scripts.zip", "ExtraContent/scripts/"), - ("extracontent-models.zip", "ExtraContent/models/") -]; - pub fn get_latest_version_hash(binary: &str, channel: &str) -> String { fetch_latest_version(LatestVersion { channel: Cow::Borrowed(channel), @@ -194,12 +137,7 @@ pub fn get_binary_type(package_manifest: Vec<&str>) -> &str { } pub fn write_appsettings_xml(path: String) { // spaghetti - fs::write(format!("{}/AppSettings.xml", path), "\ - - - content - http://www.roblox.com -").expect("Failed to write AppSettings.xml"); + fs::write(format!("{}/AppSettings.xml", path), appsettings::XML_DATA).expect("Failed to write AppSettings.xml"); } pub fn download_deployment(binary: &str, version_hash: String, channel: &str) -> String { @@ -215,7 +153,7 @@ pub fn download_deployment(binary: &str, version_hash: String, channel: &str) -> status!("Downloading deployment..."); status!("Using cache directory: {temp_path}"); - let bindings: &[_] = if binary == "Player" { &PLAYER_EXTRACT_BINDINGS } else { &STUDIO_EXTRACT_BINDINGS }; + let bindings: &[_] = if binary == "Player" { &bindings::PLAYER_EXTRACT_BINDINGS } else { &bindings::STUDIO_EXTRACT_BINDINGS }; let deployment_channel = if channel == "LIVE" { LIVE_DEPLOYMENT_CDN.to_string() } else { format!("{CHANNEL_DEPLOYMENT_CDN}{channel}/") }; status!("Using deployment CDN URL: {}", deployment_channel); @@ -245,7 +183,7 @@ pub fn download_deployment(binary: &str, version_hash: String, channel: &str) -> } pub fn extract_deployment_zips(binary: &str, temp_path: String, extraction_path: String, disallow_multithreading: bool) { - let bindings: &[_] = if binary == "Player" { &PLAYER_EXTRACT_BINDINGS } else { &STUDIO_EXTRACT_BINDINGS }; + let bindings: &[_] = if binary == "Player" { &bindings::PLAYER_EXTRACT_BINDINGS } else { &bindings::STUDIO_EXTRACT_BINDINGS }; help!("{} files will be extracted", bindings.len()); progress_bar::init_progress_bar_with_eta(bindings.len());