Windows support for itch.io

This commit is contained in:
Philip
2021-09-29 22:18:15 +02:00
parent 05dbaa95e4
commit c4cd59cf81
+4 -3
View File
@@ -87,9 +87,10 @@ fn get_default_location() -> String {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
fn get_default_location() -> String { fn get_default_location() -> String {
let key = "PROGRAMFILES(X86)"; let key = "APPDATA";
let program_files = env::var(key).expect("Expected a program files variable to be defined"); let appdata = std::env::var(key).expect("Expected a APPDATA variable to be defined");
format!("{}//Itch//", program_files) Path::new(&appdata).join("itch").to_str().unwrap().to_string()
//C:\Users\phili\AppData\Local\itch
} }
#[derive(Debug, Fail)] #[derive(Debug, Fail)]