diff --git a/plugins/updater/tests/app-updater/.cargo/config.toml b/plugins/updater/tests/app-updater/.cargo/config.toml new file mode 100644 index 000000000..df9765daf --- /dev/null +++ b/plugins/updater/tests/app-updater/.cargo/config.toml @@ -0,0 +1,5 @@ +[target.'cfg(windows)'] +runner = "powershell -Command Start-Process -Verb runAs -FilePath" + +[target.x86_64-unknown-linux-gnu] +runner = 'sudo -E' diff --git a/plugins/updater/tests/app-updater/src/main.rs b/plugins/updater/tests/app-updater/src/main.rs index 3d4bc5073..9d7f8a163 100644 --- a/plugins/updater/tests/app-updater/src/main.rs +++ b/plugins/updater/tests/app-updater/src/main.rs @@ -27,9 +27,7 @@ fn main() { let exe = tauri::utils::platform::current_exe().unwrap(); let dir = dunce::simplified(exe.parent().unwrap()).display(); if target == "nsis" { - builder = builder - .installer_arg("/NS") - .installer_arg(format!("/D=\"{dir}\"",)); + builder = builder.installer_arg(format!("/D=\"{dir}\"",)); } else if target == "msi" { builder = builder.installer_arg(format!("INSTALLDIR=\"{dir}\"")); } diff --git a/plugins/updater/tests/app-updater/tests/update.rs b/plugins/updater/tests/app-updater/tests/update.rs index 7237dca61..571863d2e 100644 --- a/plugins/updater/tests/app-updater/tests/update.rs +++ b/plugins/updater/tests/app-updater/tests/update.rs @@ -200,7 +200,7 @@ fn nsis() { test_update(&app, update_bundle, signature, "nsis"); // cleanup the installed application - if std::env::var("CI").map(|v| v == "true").unwrap_or_default() { + if !std::env::var("CI").map(|v| v == "true").unwrap_or_default() { let _ = Command::new(target_dir.join("debug/uninstall.exe")) .arg("/S") .status() @@ -230,7 +230,7 @@ fn msi() { test_update(&app, update_bundle, signature, "msi"); // cleanup the installed application - if std::env::var("CI").map(|v| v == "true").unwrap_or_default() { + if !std::env::var("CI").map(|v| v == "true").unwrap_or_default() { let uninstall = target_dir.join("debug/Uninstall app-updater.lnk"); let _ = Command::new("cmd") .arg("/c")