chore(autostart): update auto-launch to 0.6 (#3546)

* chore(autostart): update auto-launch to 0.6

* migrate to `set_macos_launch_mode`

* back to zzzgydi main branch

* use crates.io version of auto-launch

* Add change file

* revert unrelated bumps
This commit is contained in:
Tony authored and GitHub committed 2026-09-30 15:41:34 +08:00
1 parent e511284380
commit 2fd4bedc8b
4 files changed
+89 -183

No files matched your search

+1 -1
View File
@@ -31,4 +31,4 @@ serde = { workspace = true }
serde_json = { workspace = true }
tauri = { workspace = true }
thiserror = { workspace = true }
auto-launch = "0.5"
auto-launch = "0.6"
+11 -4
View File
@@ -35,6 +35,16 @@ pub enum MacosLauncher {
AppleScript,
}
#[cfg(target_os = "macos")]
impl MacosLauncher {
fn to_auto_launch(&self) -> auto_launch::MacOSLaunchMode {
match self {
MacosLauncher::LaunchAgent => auto_launch::MacOSLaunchMode::LaunchAgent,
MacosLauncher::AppleScript => auto_launch::MacOSLaunchMode::AppleScript,
}
}
}
/// The error type of this plugin.
#[derive(Debug, thiserror::Error)]
pub enum Error {
@@ -227,10 +237,7 @@ impl Builder {
#[cfg(target_os = "macos")]
{
builder.set_use_launch_agent(matches!(
self.macos_launcher,
MacosLauncher::LaunchAgent
));
builder.set_macos_launch_mode(self.macos_launcher.to_auto_launch());
// on macOS, current_exe gives path to /Applications/Example.app/MacOS/Example
// but this results in seeing a Unix Executable in macOS login items
// It must be: /Applications/Example.app