mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 桌面端自动下载更新安装包 https://github.com/siyuan-note/siyuan/issues/5837
This commit is contained in:
parent
654a80e810
commit
7b16134717
2 changed files with 33 additions and 18 deletions
|
|
@ -378,6 +378,7 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
||||||
// return true
|
// return true
|
||||||
//})
|
//})
|
||||||
|
|
||||||
|
if !skipNewVerInstallPkg() {
|
||||||
newVerInstallPkgPath := ""
|
newVerInstallPkgPath := ""
|
||||||
if Conf.System.DownloadInstallPkg && !util.ISMicrosoftStore {
|
if Conf.System.DownloadInstallPkg && !util.ISMicrosoftStore {
|
||||||
newVerInstallPkgPath = GetNewVerInstallPkgPath()
|
newVerInstallPkgPath = GetNewVerInstallPkgPath()
|
||||||
|
|
@ -398,6 +399,7 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
||||||
}
|
}
|
||||||
logging.LogDebugf("exec install new version output [%s]", data)
|
logging.LogDebugf("exec install new version output [%s]", data)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Conf.Close()
|
Conf.Close()
|
||||||
sql.CloseDatabase()
|
sql.CloseDatabase()
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetNewVerInstallPkgPath() string {
|
func GetNewVerInstallPkgPath() string {
|
||||||
if !Conf.System.DownloadInstallPkg || util.ISMicrosoftStore {
|
if skipNewVerInstallPkg() {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ var checkDownloadInstallPkgLock = sync.Mutex{}
|
||||||
func checkDownloadInstallPkg() {
|
func checkDownloadInstallPkg() {
|
||||||
defer logging.Recover()
|
defer logging.Recover()
|
||||||
|
|
||||||
if !Conf.System.DownloadInstallPkg || util.ISMicrosoftStore {
|
if skipNewVerInstallPkg() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -217,3 +217,16 @@ func CheckUpdate(showMsg bool) {
|
||||||
util.PushMsg(msg, timeout)
|
util.PushMsg(msg, timeout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func skipNewVerInstallPkg() bool {
|
||||||
|
if !gulu.OS.IsWindows() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if util.ISMicrosoftStore {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if !Conf.System.DownloadInstallPkg {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue