Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 桌面端自动下载更新安装包 https://github.com/siyuan-note/siyuan/issues/5837

Liang Ding04e1c9101552
diff --git a/kernel/model/conf.go b/kernel/model/conf.go
index a2709263c5..12acd68482 100644
--- a/kernel/model/conf.go
+++ b/kernel/model/conf.go
@@ -390,7 +390,14 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
if 2 == execInstallPkg && "" != newVerInstallPkgPath { // 执行新版本安装
logging.LogInfof("installing the new version [%s]", newVerInstallPkgPath)
- cmd := exec.Command(newVerInstallPkgPath)
+ var cmd *exec.Cmd
+ if gulu.OS.IsWindows() {
+ cmd = exec.Command(newVerInstallPkgPath)
+ } else if gulu.OS.IsDarwin() {
+ cmd = exec.Command("open", newVerInstallPkgPath)
+ } else if gulu.OS.IsLinux() {
+ cmd = exec.Command("sh", "-c", newVerInstallPkgPath)
+ }
util.CmdAttr(cmd)
data, cmdErr := cmd.CombinedOutput()
if nil != cmdErr {