feat(dcauth): 新增常驻托盘客户端与版本显示
Windows 改为单实例托盘常驻,协议唤起只弹一个确认窗口;补充 macOS 后台守护进程 与客户端版本显示。
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user