feat(dcauth): 新增常驻托盘客户端与版本显示

Windows 改为单实例托盘常驻,协议唤起只弹一个确认窗口;补充 macOS 后台守护进程
与客户端版本显示。
This commit is contained in:
yml2213
2026-10-21 20:46:25 +08:00
parent 040100f290
commit cb916d7750
12 changed files with 1087 additions and 73 deletions
+22 -4
View File
@@ -19,8 +19,26 @@ func registerProtocol() {
}
command := `"` + executable + `" "%1"`
_ = exec.Command("reg", "add", `HKCU\Software\Classes\dcauth`, "/ve", "/d", "URL:DCAuth Protocol", "/f").Run()
_ = exec.Command("reg", "add", `HKCU\Software\Classes\dcauth`, "/v", "URL Protocol", "/d", "", "/f").Run()
_ = exec.Command("reg", "add", `HKCU\Software\Classes\dcauth\DefaultIcon`, "/ve", "/d", executable+",0", "/f").Run()
_ = exec.Command("reg", "add", `HKCU\Software\Classes\dcauth\shell\open\command`, "/ve", "/d", command, "/f").Run()
runHiddenCommand(
"reg", "add", `HKCU\Software\Classes\dcauth`,
"/ve", "/d", "URL:DCAuth Protocol", "/f",
)
runHiddenCommand(
"reg", "add", `HKCU\Software\Classes\dcauth`,
"/v", "URL Protocol", "/d", "", "/f",
)
runHiddenCommand(
"reg", "add", `HKCU\Software\Classes\dcauth\DefaultIcon`,
"/ve", "/d", executable+",0", "/f",
)
runHiddenCommand(
"reg", "add", `HKCU\Software\Classes\dcauth\shell\open\command`,
"/ve", "/d", command, "/f",
)
}
func runHiddenCommand(name string, args ...string) {
command := exec.Command(name, args...)
hideCommandWindow(command)
_ = command.Run()
}