mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 桌面端自动下载更新安装包 https://github.com/siyuan-note/siyuan/issues/5837
This commit is contained in:
parent
8f6ffd4dcd
commit
313143304b
7 changed files with 83 additions and 20 deletions
|
|
@ -34,16 +34,23 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func isExistUpdateInstallPkg() bool {
|
||||
func GetNewVerInstallPkgPath() string {
|
||||
if !Conf.System.DownloadInstallPkg {
|
||||
return ""
|
||||
}
|
||||
|
||||
downloadPkgURL, checksum, err := getUpdatePkg()
|
||||
if nil != err {
|
||||
return false
|
||||
return ""
|
||||
}
|
||||
|
||||
pkg := path.Base(downloadPkgURL)
|
||||
savePath := filepath.Join(util.TempDir, "install", pkg)
|
||||
localChecksum, _ := sha256Hash(savePath)
|
||||
return checksum == localChecksum
|
||||
ret := filepath.Join(util.TempDir, "install", pkg)
|
||||
localChecksum, _ := sha256Hash(ret)
|
||||
if checksum != localChecksum {
|
||||
return ""
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
var checkDownloadInstallPkgLock = sync.Mutex{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue