mirror of
https://github.com/dathere/qsv-easy-windows-installer.git
synced 2025-12-19 08:39:24 +00:00
fix: add bin dir to PATH if it doesn't exist only
This commit is contained in:
parent
f0b290d17c
commit
5669653bd5
1 changed files with 5 additions and 3 deletions
|
|
@ -41,10 +41,12 @@ fn run_path_update(app_handle: tauri::AppHandle) {
|
||||||
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
||||||
let (reg_key, _) = hkcu.create_subkey("Environment").unwrap();
|
let (reg_key, _) = hkcu.create_subkey("Environment").unwrap();
|
||||||
let path_var: String = reg_key.get_value("Path").unwrap();
|
let path_var: String = reg_key.get_value("Path").unwrap();
|
||||||
// Add bin dir to PATH
|
// If bin dir is not in PATH, add bin dir to PATH
|
||||||
|
if !path_var.contains(bin_dir_str) {
|
||||||
let updated_path_var = format!("{bin_dir_str};{path_var}");
|
let updated_path_var = format!("{bin_dir_str};{path_var}");
|
||||||
reg_key.set_value("Path", &updated_path_var).unwrap();
|
reg_key.set_value("Path", &updated_path_var).unwrap();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue