From 98ce460fc96026a3d1a05aec3192770c76e8f982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0brahim=20Emir=20Akman?= <236213740+iemirakman@users.noreply.github.com> Date: Sun, 25 Oct 2026 03:17:32 +0300 Subject: [PATCH 1/3] fix(updater): clear macOS quarantine flag during self-update to prevent loop --- src-tauri/src/selfupdate.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src-tauri/src/selfupdate.rs b/src-tauri/src/selfupdate.rs index 60a7f7d..4253bfd 100644 --- a/src-tauri/src/selfupdate.rs +++ b/src-tauri/src/selfupdate.rs @@ -428,6 +428,9 @@ pub fn install(update: &ReadyUpdate, relaunch: bool) -> Result<()> { .find(|p| p.extension().is_some_and(|e| e == "app")) .ok_or_else(|| anyhow!("not running from an .app bundle"))? .to_path_buf(); + + #[cfg(target_os = "macos")] + remove_quarantine(&update.path); let script = format!( r#"sleep 2 mnt=$(mktemp -d) @@ -437,6 +440,7 @@ if [ -n "$app" ]; then rm -rf {bundle}.old && mv {bundle} {bundle}.old && ditto "$app" {bundle} && rm -rf {bundle}.old || mv {bundle}.old {bundle} fi hdiutil detach -quiet "$mnt" +xattr -rd com.apple.quarantine {bundle} 2>/dev/null || true {relaunch}"#, dmg = sh_quote(&pkg), bundle = sh_quote(&bundle.to_string_lossy()), @@ -507,6 +511,35 @@ fn relaunch_later(_exe: &Path) -> Result<()> { Ok(()) } +#[cfg(target_os = "macos")] +fn remove_quarantine(path: &Path) { + match Command::new("xattr") + .args(["-rd", "com.apple.quarantine"]) + .arg(path) + .stdin(std::process::Stdio::null()) + .stdout(std::process::Stdio::null()) + .stderr(std::process::Stdio::null()) + .status() + { + Ok(s) if s.success() => { + tracing::debug!("removed quarantine flag from {}", path.display()); + } + Ok(s) => { + tracing::warn!( + "xattr returned {} while removing quarantine from {}", + s, + path.display() + ); + } + Err(e) => { + tracing::warn!( + "could not run xattr to remove quarantine from {}: {e}", + path.display() + ); + } + } +} + #[cfg_attr(not(windows), allow(dead_code))] fn relaunch_script(pid: u32, exe: &Path) -> String { let path = exe.to_string_lossy(); From d6a57b22f04bafca1cba4d128aec31a8dfb3df8a Mon Sep 17 00:00:00 2001 From: winball501 Date: Sun, 25 Oct 2026 10:52:23 +0300 Subject: [PATCH 2/3] Remove trailing whitespace in selfupdate.rs Fixes the cargo fmt check that failed on Ubuntu. --- src-tauri/src/selfupdate.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src-tauri/src/selfupdate.rs b/src-tauri/src/selfupdate.rs index 4253bfd..8471ba1 100644 --- a/src-tauri/src/selfupdate.rs +++ b/src-tauri/src/selfupdate.rs @@ -427,8 +427,7 @@ pub fn install(update: &ReadyUpdate, relaunch: bool) -> Result<()> { .ancestors() .find(|p| p.extension().is_some_and(|e| e == "app")) .ok_or_else(|| anyhow!("not running from an .app bundle"))? - .to_path_buf(); - + .to_path_buf(); #[cfg(target_os = "macos")] remove_quarantine(&update.path); let script = format!( From 9574e433179271968c4b614b31771d00e82fa69d Mon Sep 17 00:00:00 2001 From: winball501 Date: Sun, 25 Oct 2026 11:02:17 +0300 Subject: [PATCH 3/3] Fix indentation in selfupdate.rs --- src-tauri/src/selfupdate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/src/selfupdate.rs b/src-tauri/src/selfupdate.rs index 8471ba1..311db23 100644 --- a/src-tauri/src/selfupdate.rs +++ b/src-tauri/src/selfupdate.rs @@ -427,7 +427,7 @@ pub fn install(update: &ReadyUpdate, relaunch: bool) -> Result<()> { .ancestors() .find(|p| p.extension().is_some_and(|e| e == "app")) .ok_or_else(|| anyhow!("not running from an .app bundle"))? - .to_path_buf(); + .to_path_buf(); #[cfg(target_os = "macos")] remove_quarantine(&update.path); let script = format!(