Skip to content

Commit

Permalink
try with sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Nov 21, 2024
1 parent 719cd93 commit c61b224
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions plugins/updater/tests/app-updater/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.'cfg(windows)']
runner = "powershell -Command Start-Process -Verb runAs -FilePath"

[target.x86_64-unknown-linux-gnu]
runner = 'sudo -E'
4 changes: 1 addition & 3 deletions plugins/updater/tests/app-updater/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}\""));
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/updater/tests/app-updater/tests/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit c61b224

Please sign in to comment.