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

This commit is contained in:
Liang Ding 2022-09-09 08:49:20 +08:00
parent 7b16134717
commit 04e1c91015
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -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 {