diff --git a/.gitignore b/.gitignore index acbb16c1e..8787a8129 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,4 @@ npm-debug.log.* *.scss.d.ts # externals -externals/**/target/* +externals/**/target/** diff --git a/assets/scripts/oculus-allow-dev-sideloaded.exe b/assets/scripts/oculus-allow-dev-sideloaded.exe index 90c684bee..cb998813a 100644 Binary files a/assets/scripts/oculus-allow-dev-sideloaded.exe and b/assets/scripts/oculus-allow-dev-sideloaded.exe differ diff --git a/assets/scripts/start_beat_saber_admin.exe b/assets/scripts/start_beat_saber_admin.exe index c898e9d34..e7c57a100 100644 Binary files a/assets/scripts/start_beat_saber_admin.exe and b/assets/scripts/start_beat_saber_admin.exe differ diff --git a/externals/bs-admin-start/Cargo.lock b/externals/bs-admin-start/Cargo.lock index f15d82793..ddd85aafd 100644 --- a/externals/bs-admin-start/Cargo.lock +++ b/externals/bs-admin-start/Cargo.lock @@ -2,6 +2,52 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "erased-serde" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +dependencies = [ + "serde", + "typeid", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "log" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6ea2a48c204030ee31a7d7fc72c93294c92fe87ecb1789881c9543516e1a0d" +dependencies = [ + "value-bag", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro2" version = "1.0.76" @@ -20,6 +66,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + [[package]] name = "serde" version = "1.0.195" @@ -40,13 +92,112 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_fmt" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" +dependencies = [ + "serde", +] + +[[package]] +name = "simplelog" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16257adbfaef1ee58b1363bdc0664c9b8e1e30aed86049635fb5f147d065a9c0" +dependencies = [ + "log", + "time", +] + [[package]] name = "start_beat_saber_admin" version = "0.1.0" dependencies = [ + "log", + "simplelog", "winres", ] +[[package]] +name = "sval" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8" + +[[package]] +name = "sval_buffer" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f" +dependencies = [ + "sval", + "sval_ref", +] + +[[package]] +name = "sval_dynamic" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_fmt" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_json" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_nested" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f" +dependencies = [ + "sval", + "sval_buffer", + "sval_ref", +] + +[[package]] +name = "sval_ref" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_serde" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a" +dependencies = [ + "serde", + "sval", + "sval_nested", +] + [[package]] name = "syn" version = "2.0.48" @@ -58,6 +209,37 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "time" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "toml" version = "0.5.11" @@ -67,12 +249,54 @@ dependencies = [ "serde", ] +[[package]] +name = "typeid" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "value-bag" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" +dependencies = [ + "value-bag-serde1", + "value-bag-sval2", +] + +[[package]] +name = "value-bag-serde1" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b" +dependencies = [ + "erased-serde", + "serde", + "serde_fmt", +] + +[[package]] +name = "value-bag-sval2" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a" +dependencies = [ + "sval", + "sval_buffer", + "sval_dynamic", + "sval_fmt", + "sval_json", + "sval_ref", + "sval_serde", +] + [[package]] name = "winres" version = "0.1.12" diff --git a/externals/bs-admin-start/Cargo.toml b/externals/bs-admin-start/Cargo.toml index 118f1b320..9eadbd7b2 100644 --- a/externals/bs-admin-start/Cargo.toml +++ b/externals/bs-admin-start/Cargo.toml @@ -4,6 +4,10 @@ version = "0.1.0" edition = "2021" build = "build.rs" +[dependencies] +simplelog = { version = "0.12.2", default-features = false } +log = "0.4.24" + [build-dependencies] winres = "0.1.12" @@ -11,6 +15,7 @@ winres = "0.1.12" codegen-units = 1 lto = true opt-level = "z" +panic = "abort" [package.metadata.winres] FileDescription = "Start Beat Saber as Admin" diff --git a/externals/bs-admin-start/rust-toolchain.toml b/externals/bs-admin-start/rust-toolchain.toml new file mode 100644 index 000000000..83025f972 --- /dev/null +++ b/externals/bs-admin-start/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.77.0" diff --git a/externals/bs-admin-start/src/main.rs b/externals/bs-admin-start/src/main.rs index 5964e94ff..8ef7679ce 100644 --- a/externals/bs-admin-start/src/main.rs +++ b/externals/bs-admin-start/src/main.rs @@ -1,5 +1,10 @@ use std::{process::Command, path::Path}; +use std::env::current_exe; +use std::fs::File; +use std::path::PathBuf; +use log::{error, info, LevelFilter}; +use simplelog::{CombinedLogger, Config, WriteLogger}; const EXECUTABLE_NAME: &str = "Beat Saber.exe"; const AUTORIZED_ARGS: [&str; 8] = [ @@ -14,18 +19,37 @@ const AUTORIZED_ARGS: [&str; 8] = [ ]; fn main() { + + let default_log_file_path = current_exe().unwrap().with_file_name("bs-admin-start.log"); + let args: Vec = std::env::args().collect(); + + let log_file_path: PathBuf = if let Some(pos) = args.iter().position(|arg| arg == "--log-path") { + if let Some(log_path) = args.get(pos + 1) { + PathBuf::from(log_path) + } else { + default_log_file_path + } + } else { + default_log_file_path + }; + + CombinedLogger::init( + vec![ + WriteLogger::new(LevelFilter::Info, Config::default(), File::create(log_file_path).unwrap()), + ] + ).unwrap(); + + let args: Vec = std::env::args().collect(); let executable_path = Path::new(&args[1]); if executable_path.file_name().unwrap() != EXECUTABLE_NAME { - eprintln!("Executable path is not Beat Saber.exe."); - return; + return error!("Executable path is not Beat Saber.exe."); } if !executable_path.exists() || !executable_path.is_file() { - eprintln!("Executable path is not valid."); - return; + return error!("Executable path is not valid."); } let mut command = Command::new(executable_path); @@ -43,5 +67,11 @@ fn main() { command.env("SteamAppId", "620980"); - let _ = command.spawn(); + let res = command.spawn(); + + if let Err(e) = res { + return error!("Failed to start Beat Saber ({}): {}", executable_path.display(), e); + } + + info!("Beat Saber started ({})", executable_path.display()); } diff --git a/externals/oculus-allow-dev-sideloaded/Cargo.lock b/externals/oculus-allow-dev-sideloaded/Cargo.lock index 0a369b4d6..25aa7fe03 100644 --- a/externals/oculus-allow-dev-sideloaded/Cargo.lock +++ b/externals/oculus-allow-dev-sideloaded/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +version = 3 [[package]] name = "cfg-if" @@ -8,19 +8,67 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "erased-serde" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +dependencies = [ + "serde", + "typeid", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "log" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6ea2a48c204030ee31a7d7fc72c93294c92fe87ecb1789881c9543516e1a0d" +dependencies = [ + "value-bag", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "oculus-allow-dev-sideloaded" version = "0.1.0" dependencies = [ + "log", + "simplelog", "winreg", "winres", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -34,6 +82,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + [[package]] name = "serde" version = "1.0.217" @@ -54,17 +108,145 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_fmt" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" +dependencies = [ + "serde", +] + +[[package]] +name = "simplelog" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16257adbfaef1ee58b1363bdc0664c9b8e1e30aed86049635fb5f147d065a9c0" +dependencies = [ + "log", + "time", +] + +[[package]] +name = "sval" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8" + +[[package]] +name = "sval_buffer" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f" +dependencies = [ + "sval", + "sval_ref", +] + +[[package]] +name = "sval_dynamic" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_fmt" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_json" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_nested" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f" +dependencies = [ + "sval", + "sval_buffer", + "sval_ref", +] + +[[package]] +name = "sval_ref" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_serde" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a" +dependencies = [ + "serde", + "sval", + "sval_nested", +] + [[package]] name = "syn" -version = "2.0.93" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "time" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "toml" version = "0.5.11" @@ -74,12 +256,54 @@ dependencies = [ "serde", ] +[[package]] +name = "typeid" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" + [[package]] name = "unicode-ident" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +[[package]] +name = "value-bag" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" +dependencies = [ + "value-bag-serde1", + "value-bag-sval2", +] + +[[package]] +name = "value-bag-serde1" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b" +dependencies = [ + "erased-serde", + "serde", + "serde_fmt", +] + +[[package]] +name = "value-bag-sval2" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a" +dependencies = [ + "sval", + "sval_buffer", + "sval_dynamic", + "sval_fmt", + "sval_json", + "sval_ref", + "sval_serde", +] + [[package]] name = "windows-sys" version = "0.48.0" diff --git a/externals/oculus-allow-dev-sideloaded/Cargo.toml b/externals/oculus-allow-dev-sideloaded/Cargo.toml index d79af150b..31344e637 100644 --- a/externals/oculus-allow-dev-sideloaded/Cargo.toml +++ b/externals/oculus-allow-dev-sideloaded/Cargo.toml @@ -6,8 +6,11 @@ edition = "2021" [build-dependencies] winres = "0.1.12" + [dependencies] winreg = "0.52.0" +simplelog = { version = "0.12.2", default-features = false } +log = "0.4.24" [package.metadata.winres] FileDescription = "Enable Sideloaded Apps" @@ -18,3 +21,4 @@ CompanyName = "Zagrios" codegen-units = 1 lto = true opt-level = "z" +panic = "abort" diff --git a/externals/oculus-allow-dev-sideloaded/rust-toolchain.toml b/externals/oculus-allow-dev-sideloaded/rust-toolchain.toml new file mode 100644 index 000000000..83025f972 --- /dev/null +++ b/externals/oculus-allow-dev-sideloaded/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.77.0" diff --git a/externals/oculus-allow-dev-sideloaded/src/main.rs b/externals/oculus-allow-dev-sideloaded/src/main.rs index d2155d624..da44db355 100644 --- a/externals/oculus-allow-dev-sideloaded/src/main.rs +++ b/externals/oculus-allow-dev-sideloaded/src/main.rs @@ -1,22 +1,48 @@ +use std::env::current_exe; +use std::fs::File; +use std::path::PathBuf; +use simplelog::{CombinedLogger, Config, LevelFilter, WriteLogger}; use winreg::enums::HKEY_LOCAL_MACHINE; use winreg::RegKey; +use log::{error, info}; -const PATH: &str = "SOFTWARE\\Wow6432Node\\Oculus VR, LLC\\Oculus"; +const REG_PATH: &str = "SOFTWARE\\Wow6432Node\\Oculus VR, LLC\\Oculus"; fn main() { + + let default_log_file_path = current_exe().unwrap().with_file_name("oculus-allow-dev-sideloaded.log"); + let args: Vec = std::env::args().collect(); + + let log_file_path: PathBuf = if let Some(pos) = args.iter().position(|arg| arg == "--log-path") { + if let Some(log_path) = args.get(pos + 1) { + PathBuf::from(log_path) + } else { + default_log_file_path + } + } else { + default_log_file_path + }; + + CombinedLogger::init( + vec![ + WriteLogger::new(LevelFilter::Info, Config::default(), File::create(log_file_path).unwrap()), + ] + ).unwrap(); + let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); - // Create (or open if it already exists) the subkey - let (key, _) = match hklm.create_subkey(PATH) { + info!("Opening or creating subkey ({})...", REG_PATH); + let (key, _) = match hklm.create_subkey(REG_PATH) { Ok(res) => res, - Err(err) => return println!("{}", err.to_string()), + Err(err) => return error!("Unable to create subkey ({}) : {}", REG_PATH, err.to_string()) }; + info!("Setting value AllowDevSideloaded = 1 in {REG_PATH}..."); let res = key.set_value("AllowDevSideloaded", &1u32); if let Err(err) = res { - return println!("{}", err.to_string()); + return error!("Unable to set value AllowDevSideloaded = 1 in {REG_PATH} : {}", err.to_string()); } - println!("AllowDevSideloaded = 1 has been successfully set in {PATH}"); + info!("AllowDevSideloaded = 1 has been successfully set in {REG_PATH}"); } diff --git a/src/main/services/bs-launcher/steam-launcher.service.ts b/src/main/services/bs-launcher/steam-launcher.service.ts index fdae1e1cb..d3d25b312 100644 --- a/src/main/services/bs-launcher/steam-launcher.service.ts +++ b/src/main/services/bs-launcher/steam-launcher.service.ts @@ -11,6 +11,7 @@ import { CustomError } from "../../../shared/models/exceptions/custom-error.clas import { UtilsService } from "../utils.service"; import { exec } from "child_process"; import { LaunchMods } from "shared/models/bs-launch/launch-option.interface"; +import { app } from "electron"; export class SteamLauncherService extends AbstractLauncherService implements StoreLauncherInterface{ @@ -124,7 +125,7 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto this.launchBs(bsExePath, launchArgs, spawnOpts).exit ) : ( new Promise(resolve => { - const adminProcess = exec(`"${this.getStartBsAsAdminExePath()}" "${bsExePath}" ${launchArgs.join(" ")}`, spawnOpts); + const adminProcess = exec(`"${this.getStartBsAsAdminExePath()}" "${bsExePath}" ${launchArgs.join(" ")} --log-path "${path.join(app.getPath("logs"), "bs-admin-start.log")}"`, spawnOpts); adminProcess.on("error", err => { log.error("Error while starting BS as Admin", err); resolve(-1) diff --git a/src/main/services/oculus.service.ts b/src/main/services/oculus.service.ts index 05dc5ad50..07bbfeba9 100644 --- a/src/main/services/oculus.service.ts +++ b/src/main/services/oculus.service.ts @@ -3,7 +3,7 @@ import { pathExist, resolveGUIDPath } from "../helpers/fs.helpers"; import log from "electron-log"; import { lstat } from "fs-extra"; import { tryit } from "../../shared/helpers/error.helpers"; -import { shell } from "electron"; +import { app, shell } from "electron"; import { isProcessRunning } from "../helpers/os.helpers"; import { sToMs } from "../../shared/helpers/time.helpers"; import { execOnOs } from "../helpers/env.helpers"; @@ -169,7 +169,7 @@ export class OculusService { return new Promise((resolve, reject) => { log.info("Enabling sideloaded apps"); - const process = exec(exePath); + const process = exec(`"${exePath}" --log-path "${path.join(app.getPath("logs"), "oculus-allow-dev-sideloaded.log")}"`); process.on("exit", code => { if(code === 0){ resolve();