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

This commit is contained in:
Liang Ding 2022-09-09 09:12:21 +08:00
parent 920ead1e01
commit f33a534ad8
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -360,6 +360,8 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
exitLock.Lock()
defer exitLock.Unlock()
logging.LogInfof("exiting kernel [force=%v, execInstallPkg=%d]", force, execInstallPkg)
treenode.CloseBlockTree()
util.PushMsg(Conf.Language(95), 10000*60)
WaitForWritingFiles()
@ -378,18 +380,16 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
//})
if !skipNewVerInstallPkg() {
newVerInstallPkgPath := ""
if Conf.System.DownloadInstallPkg && !util.ISMicrosoftStore {
newVerInstallPkgPath = getNewVerInstallPkgPath()
if "" != newVerInstallPkgPath && 0 == execInstallPkg {
newVerInstallPkgPath := getNewVerInstallPkgPath()
if "" != newVerInstallPkgPath {
if 0 == execInstallPkg { // 新版本安装包已经准备就绪
exitCode = 2
logging.LogInfof("the new version install pkg is ready [%s], waiting for the user's next instruction", newVerInstallPkgPath)
return
} else if 2 == execInstallPkg { // 执行新版本安装
go execNewVerInstallPkg(newVerInstallPkgPath)
}
}
if 2 == execInstallPkg && "" != newVerInstallPkgPath { // 执行新版本安装
go execNewVerInstallPkg(newVerInstallPkgPath)
}
}
Conf.Close()