Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 72 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion plugins/autostart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ serde = { workspace = true }
serde_json = { workspace = true }
tauri = { workspace = true }
thiserror = { workspace = true }
auto-launch = "0.5"
# auto-launch = "0.6"
auto-launch = { git = "https://github.com/Legend-Master/auto-launch.git", branch = "relax-windows-registry-versions" }
15 changes: 11 additions & 4 deletions plugins/autostart/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,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,
}
}
}

#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
Expand Down Expand Up @@ -190,10 +200,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
Expand Down
Loading