support alternative key
This commit is contained in:
parent
f3503df2ec
commit
71038e9a44
1 changed files with 12 additions and 7 deletions
19
src/main.rs
19
src/main.rs
|
@ -76,6 +76,7 @@ fn main() {
|
||||||
Ok(x) => x,
|
Ok(x) => x,
|
||||||
Err(_e) => PathBuf::from(LOL_CHAMPS_DIR),
|
Err(_e) => PathBuf::from(LOL_CHAMPS_DIR),
|
||||||
};
|
};
|
||||||
|
info!("LoL Champs Folder: {}", lol_champs_dir.to_str().unwrap());
|
||||||
|
|
||||||
let mut headers = Headers::new();
|
let mut headers = Headers::new();
|
||||||
headers.set(UserAgent::new(USER_AGENT));
|
headers.set(UserAgent::new(USER_AGENT));
|
||||||
|
@ -276,11 +277,15 @@ fn write_item_set(
|
||||||
|
|
||||||
fn lol_champ_dir() -> Result<PathBuf, io::Error> {
|
fn lol_champ_dir() -> Result<PathBuf, io::Error> {
|
||||||
let hklm = RegKey::predef(winreg::enums::HKEY_LOCAL_MACHINE);
|
let hklm = RegKey::predef(winreg::enums::HKEY_LOCAL_MACHINE);
|
||||||
let node = hklm.open_subkey(r"SOFTWARE\WOW6432Node\Riot Games\RADS")?;
|
let node = hklm.open_subkey(r"SOFTWARE\WOW6432Node\Riot Games\RADS");
|
||||||
let dir: String = node.get_value("LocalRootFolder")?;
|
let path: PathBuf;
|
||||||
Ok(PathBuf::from(&dir)
|
if node.is_ok() {
|
||||||
.parent()
|
let val: String = node?.get_value("LocalRootFolder")?;
|
||||||
.unwrap()
|
path = PathBuf::from(val).parent().unwrap().to_path_buf();
|
||||||
.join("Config")
|
} else {
|
||||||
.join("Champions"))
|
let node = hklm.open_subkey(r"SOFTWARE\WOW6432Node\Riot Games, Inc\League of Legends");
|
||||||
|
let val: String = node?.get_value("Location")?;
|
||||||
|
path = PathBuf::from(val);
|
||||||
|
}
|
||||||
|
Ok(path.join("Config").join("Champions"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue