mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 桌面端自动下载更新安装包 https://github.com/siyuan-note/siyuan/issues/5837
This commit is contained in:
parent
684e430fe1
commit
e4ddd99863
7 changed files with 18 additions and 11 deletions
|
|
@ -125,7 +125,7 @@ export const about = {
|
||||||
<svg><use xlink:href="#iconRefresh"></use></svg>${window.siyuan.languages.checkUpdate}
|
<svg><use xlink:href="#iconRefresh"></use></svg>${window.siyuan.languages.checkUpdate}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="fn__flex b3-label${isBrowser() ? " fn__none" : ""}">
|
<div class="fn__flex b3-label${isBrowser() || window.siyuan.config.system.isMicrosoftStore ? " fn__none" : ""}">
|
||||||
<div class="fn__flex-1">
|
<div class="fn__flex-1">
|
||||||
${window.siyuan.languages.autoDownloadUpdatePkg}
|
${window.siyuan.languages.autoDownloadUpdatePkg}
|
||||||
<div class="b3-label__text">${window.siyuan.languages.autoDownloadUpdatePkgTip}</div>
|
<div class="b3-label__text">${window.siyuan.languages.autoDownloadUpdatePkgTip}</div>
|
||||||
|
|
|
||||||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -299,6 +299,7 @@ declare interface IConfig {
|
||||||
confDir: string
|
confDir: string
|
||||||
dataDir: string
|
dataDir: string
|
||||||
container: "std" | "android" | "docker" | "ios"
|
container: "std" | "android" | "docker" | "ios"
|
||||||
|
isMicrosoftStore: boolean
|
||||||
os: "windows" | "linux" | "darwin"
|
os: "windows" | "linux" | "darwin"
|
||||||
homeDir: string
|
homeDir: string
|
||||||
xanadu: boolean
|
xanadu: boolean
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type System struct {
|
type System struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
KernelVersion string `json:"kernelVersion"`
|
KernelVersion string `json:"kernelVersion"`
|
||||||
OS string `json:"os"`
|
OS string `json:"os"`
|
||||||
Container string `json:"container"` // docker, android, ios, std
|
Container string `json:"container"` // docker, android, ios, std
|
||||||
IsInsider bool `json:"isInsider"`
|
IsMicrosoftStore bool `json:"isMicrosoftStore"`
|
||||||
|
IsInsider bool `json:"isInsider"`
|
||||||
|
|
||||||
HomeDir string `json:"homeDir"`
|
HomeDir string `json:"homeDir"`
|
||||||
WorkspaceDir string `json:"workspaceDir"`
|
WorkspaceDir string `json:"workspaceDir"`
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,7 @@ func InitConf() {
|
||||||
Conf.System.WorkspaceDir = util.WorkspaceDir
|
Conf.System.WorkspaceDir = util.WorkspaceDir
|
||||||
Conf.System.DataDir = util.DataDir
|
Conf.System.DataDir = util.DataDir
|
||||||
Conf.System.Container = util.Container
|
Conf.System.Container = util.Container
|
||||||
|
Conf.System.IsMicrosoftStore = util.ISMicrosoftStore
|
||||||
Conf.System.OS = runtime.GOOS
|
Conf.System.OS = runtime.GOOS
|
||||||
Conf.Newbie = util.IsNewbie
|
Conf.Newbie = util.IsNewbie
|
||||||
|
|
||||||
|
|
@ -375,7 +376,7 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
||||||
//})
|
//})
|
||||||
|
|
||||||
newVerInstallPkgPath := ""
|
newVerInstallPkgPath := ""
|
||||||
if Conf.System.DownloadInstallPkg && 0 == execInstallPkg {
|
if Conf.System.DownloadInstallPkg && !util.ISMicrosoftStore && 0 == execInstallPkg {
|
||||||
newVerInstallPkgPath = GetNewVerInstallPkgPath()
|
newVerInstallPkgPath = GetNewVerInstallPkgPath()
|
||||||
if "" != newVerInstallPkgPath {
|
if "" != newVerInstallPkgPath {
|
||||||
exitCode = 2
|
exitCode = 2
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetNewVerInstallPkgPath() string {
|
func GetNewVerInstallPkgPath() string {
|
||||||
if !Conf.System.DownloadInstallPkg {
|
if !Conf.System.DownloadInstallPkg || util.ISMicrosoftStore {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ var checkDownloadInstallPkgLock = sync.Mutex{}
|
||||||
func checkDownloadInstallPkg() {
|
func checkDownloadInstallPkg() {
|
||||||
defer logging.Recover()
|
defer logging.Recover()
|
||||||
|
|
||||||
if !Conf.System.DownloadInstallPkg {
|
if !Conf.System.DownloadInstallPkg || util.ISMicrosoftStore {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,9 @@ func Boot() {
|
||||||
Container = ContainerDocker
|
Container = ContainerDocker
|
||||||
}
|
}
|
||||||
|
|
||||||
|
msStoreFilePath := filepath.Join(WorkingDir, "ms-store")
|
||||||
|
ISMicrosoftStore = gulu.File.IsExist(msStoreFilePath)
|
||||||
|
|
||||||
UserAgent = UserAgent + " " + Container
|
UserAgent = UserAgent + " " + Container
|
||||||
httpclient.SetUserAgent(UserAgent)
|
httpclient.SetUserAgent(UserAgent)
|
||||||
|
|
||||||
|
|
@ -276,7 +279,8 @@ var (
|
||||||
AccessAuthCode string
|
AccessAuthCode string
|
||||||
Lang = ""
|
Lang = ""
|
||||||
|
|
||||||
Container string // docker, android, ios, std
|
Container string // docker, android, ios, std
|
||||||
|
ISMicrosoftStore bool // 桌面端是否是微软商店版
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
||||||
|
|
@ -35,5 +35,5 @@ call pnpm run dist-win32
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
echo 'Building Appx'
|
echo 'Building Appx'
|
||||||
echo . > app\build\win-unpacked\resources\ms-store
|
cd . > app\build\win-unpacked\resources\ms-store
|
||||||
electron-windows-store --input-directory app\build\win-unpacked --output-directory app\build\ --package-version 1.0.0.0 --package-name SiYuan --manifest app\appx\AppxManifest.xml --assets app\appx\assets\ --make-pri true
|
electron-windows-store --input-directory app\build\win-unpacked --output-directory app\build\ --package-version 1.0.0.0 --package-name SiYuan --manifest app\appx\AppxManifest.xml --assets app\appx\assets\ --make-pri true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue