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

This commit is contained in:
Liang Ding 2022-09-08 22:53:50 +08:00
parent 9f31270b90
commit 9f5097ebe3
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 19 additions and 19 deletions

View file

@ -362,7 +362,7 @@ func exit(c *gin.Context) {
ret.Msg = model.Conf.Language(96) + "<div class=\"fn__space\"></div><button class=\"b3-button b3-button--white\">" + model.Conf.Language(97) + "</button>"
ret.Data = map[string]interface{}{"closeTimeout": 0}
case 2: // 提示新安装包
ret.Msg = model.Conf.Language(61) + "<div class=\"fn__space\"></div><button class=\"b3-button b3-button--white\">" + model.Conf.Language(68) + "</button><button class=\"b3-button b3-button--white\">" + model.Conf.Language(62) + "</button>"
ret.Msg = model.Conf.Language(61)
ret.Data = map[string]interface{}{"closeTimeout": 0}
}
}

View file

@ -379,16 +379,16 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
//})
newVerInstallPkgPath := ""
if Conf.System.DownloadInstallPkg && !util.ISMicrosoftStore && 0 == execInstallPkg {
if Conf.System.DownloadInstallPkg && !util.ISMicrosoftStore {
newVerInstallPkgPath = GetNewVerInstallPkgPath()
if "" != newVerInstallPkgPath {
if "" != newVerInstallPkgPath && 0 == execInstallPkg {
exitCode = 2
return
}
}
if 2 == execInstallPkg && "" != newVerInstallPkgPath { // 执行新版本安装
logging.LogInfof("install new version [%s]", newVerInstallPkgPath)
logging.LogInfof("installing the new version [%s]", newVerInstallPkgPath)
cmd := exec.Command(newVerInstallPkgPath)
util.CmdAttr(cmd)
data, cmdErr := cmd.CombinedOutput()