This commit is contained in:
parent
edd9e264c8
commit
f65f493e6c
1 changed files with 8 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
use indexmap::IndexMap;
|
||||
use log::{debug, error, info, LevelFilter};
|
||||
#[cfg(target_os = "windows")]
|
||||
use log::debug;
|
||||
use log::{error, info, LevelFilter};
|
||||
use serde_derive::Deserialize;
|
||||
use simple_logger::SimpleLogger;
|
||||
use std::env;
|
||||
|
@ -45,10 +47,14 @@ const USER_AGENT_KEY: &str = "User-Agent";
|
|||
const USER_AGENT_VALUE: &str =
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0";
|
||||
const DEFAULT_LOL_CHAMPS_DIR: &str = ".\\champs";
|
||||
#[cfg(target_os = "windows")]
|
||||
const REG_KEY_LOL_RADS: &str = r"SOFTWARE\WOW6432Node\Riot Games\RADS";
|
||||
#[cfg(target_os = "windows")]
|
||||
const REG_KEY_LOL_INC: &str = r"SOFTWARE\WOW6432Node\Riot Games, Inc\League of Legends";
|
||||
#[cfg(target_os = "windows")]
|
||||
const REG_KEY_WIN_64_UNINSTALL: &str =
|
||||
r"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall";
|
||||
#[cfg(target_os = "windows")]
|
||||
const REG_KEY_WIN_UNINSTALL: &str = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\";
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
@ -196,6 +202,7 @@ fn lol_champ_dir() -> Result<PathBuf, Error> {
|
|||
Ok(PathBuf::from(DEFAULT_LOL_CHAMPS_DIR))
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
fn find_subnode_from_path(reg: RegKey, path: &str, key: &str) -> io::Result<RegKey> {
|
||||
if let Ok(node) = reg.open_subkey(path) {
|
||||
if let Some(k) = node
|
||||
|
|
Loading…
Add table
Reference in a new issue