From bd589c44223bb39f904daf07d2c33c162c6bec81 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Fri, 12 Jul 2024 20:46:38 +0800 Subject: [PATCH] fix: service install failed on macos --- src-tauri/src/core/service.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src-tauri/src/core/service.rs b/src-tauri/src/core/service.rs index 4f9db5f..7dc7399 100644 --- a/src-tauri/src/core/service.rs +++ b/src-tauri/src/core/service.rs @@ -103,6 +103,12 @@ pub async fn install_service() -> Result<()> { if !installer_path.exists() { bail!("installer not found"); } + + let _ = StdCommand::new("chmod") + .arg("+x") + .arg(installer_path.to_string_lossy().replace(" ", "\\ ")) + .output(); + let shell = installer_path.to_string_lossy().replace(" ", "\\\\ "); let command = format!(r#"do shell script "{shell}" with administrator privileges"#);