将 macOS 托盘 LaunchAgent 的 KeepAlive 设置为 false,避免用户退出后被 launchd 立即拉起。 托盘退出菜单主动卸载当前 LaunchAgent,再结束托盘进程。 保留旧版本通过 launchctl bootout 清理服务的升级恢复路径。
12 lines
216 B
Go
12 lines
216 B
Go
//go:build !windows && !darwin
|
|
|
|
package main
|
|
|
|
import "fmt"
|
|
|
|
func serviceAction(action string) error {
|
|
return fmt.Errorf("当前平台不支持托盘服务操作: %s", action)
|
|
}
|
|
|
|
func quitTray() error { return nil }
|