Skip to content

Commit

Permalink
chore: update startup path without prompting
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Noah committed Aug 23, 2024
1 parent fca2467 commit 5ce05d9
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,29 +249,27 @@ fn add_to_startup() {
let path = std::env::current_exe().unwrap();
let existing_path = win32utils::registry::read_string(win32utils::registry::HKEY::CurrentUser, subkey, name).unwrap_or_default();

println!("Existing path: {}", existing_path);

if existing_path == path.to_string_lossy() {
return;
}
}
Ok(false) => {}
Ok(false) => {
match win32utils::dialog(
"Steam Screenshot Organizer",
"Would you like to add Steam Screenshot Organizer to startup?",
win32utils::DialogIcon::Question,
win32utils::DialogButtons::YesNo,
) {
win32utils::DialogResult::Yes => (),
_ => return,
}
}
Err(error) => {
eprintln!("Failed to check registry key: {}", error.to_string());
return;
}
}

match win32utils::dialog(
"Steam Screenshot Organizer",
"Would you like to add Steam Screenshot Organizer to startup?",
win32utils::DialogIcon::Question,
win32utils::DialogButtons::YesNo,
) {
win32utils::DialogResult::Yes => (),
_ => return,
}

let path = std::env::current_exe().unwrap();

if win32utils::registry::write_string(win32utils::registry::HKEY::CurrentUser, &subkey, &name, path.to_string_lossy()).is_err() {
Expand Down

0 comments on commit 5ce05d9

Please sign in to comment.