From 4b9fa8b339db3d02de274a24c3e2427b5d22c736 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 11 Nov 2022 10:09:36 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=A1=8C=E9=9D=A2=E7=AB=AF=E9=80=80?= =?UTF-8?q?=E5=87=BA=E6=8B=89=E8=B5=B7=E6=9B=B4=E6=96=B0=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E6=97=B6=E6=9C=89=E6=97=B6=E9=9C=80=E8=A6=81=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E4=B8=A4=E6=AC=A1=20Fix=20https://github.com/siyuan-note/siyua?= =?UTF-8?q?n/issues/6544?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/appearance/langs/en_US.json | 2 +- app/appearance/langs/es_ES.json | 2 +- app/appearance/langs/fr_FR.json | 2 +- app/appearance/langs/zh_CHT.json | 2 +- app/appearance/langs/zh_CN.json | 2 +- app/installer.nsh | 1 - app/src/dialog/processSystem.ts | 13 +++++++++++-- kernel/model/conf.go | 10 ++++------ 8 files changed, 20 insertions(+), 14 deletions(-) diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json index d5b3b7ce6..4d8da35ec 100644 --- a/app/appearance/langs/en_US.json +++ b/app/appearance/langs/en_US.json @@ -947,7 +947,7 @@ "127": "There are [%d] days left before the subscription expires, after which the cloud data will be completely deleted. Please visit Here, if you don't need to renew, please log out of your account to close the reminder", "128": "Subscription has expired, cloud data will be completely deleted after expiration. To renew, please visit here , if you don't need to renew, please log out of your account to close the reminder", "129": "Cloud data has been corrupted, please refer to here to resolve the issue", - "130": "TODO", + "130": "Starting new version installer...", "131": "TODO", "132": "TODO", "133": "TODO", diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json index 2ddabdaf4..c438deb0f 100644 --- a/app/appearance/langs/es_ES.json +++ b/app/appearance/langs/es_ES.json @@ -947,7 +947,7 @@ "127": "There are [%d] days left before the subscription expires, after which the cloud data will be completely deleted. Please visit Aquí para la renovación, si no necesita renovar, salga de su cuenta para cerrar el recordatorio", "128": "La suscripción ha caducado, los datos de la nube se eliminarán completamente después de la expiración. Para renovar, visite Aquí, si no necesita renovar, salga de su cuenta para cerrar el recordatorio", "129": "Los datos de la nube se han dañado, consulte aquí para resolver el problema", - "130": "TODO", + "130": "Iniciando instalador de nueva versión...", "131": "TODO", "132": "TODO", "133": "TODO", diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json index 6916586e6..531e1d750 100644 --- a/app/appearance/langs/fr_FR.json +++ b/app/appearance/langs/fr_FR.json @@ -947,7 +947,7 @@ "127": "Il reste [%d] jours avant l'expiration de l'abonnement, après quoi les données cloud seront complètement supprimées. Veuillez visiter ici, si vous n'avez pas besoin de renouveler, veuillez vous déconnecter de votre compte pour fermer le rappel", "128": "L'abonnement a expiré, les données cloud seront complètement supprimées après l'expiration. Pour renouveler, veuillez visiter ici , si vous n'avez pas besoin de renouveler, veuillez vous déconnecter de votre compte pour fermer le rappel", "129": "Les données cloud ont été corrompues, veuillez vous référer à ici pour résoudre le problème", - "130": "TODO", + "130": "Démarrage du programme d'installation de la nouvelle version...", "131": "TODO", "132": "TODO", "133": "TODO", diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json index f4a2d84f3..b9024010b 100644 --- a/app/appearance/langs/zh_CHT.json +++ b/app/appearance/langs/zh_CHT.json @@ -947,7 +947,7 @@ "127": "訂閱距過期還剩 [%d] 天,過期後雲端數據會被徹底刪除。續訂請訪問這裡,如果不需要續訂,請登出賬號關閉該提醒", "128": "訂閱已經過期,過期後雲端數據會被徹底刪除。續訂請訪問這裡,如果不需要續訂,請登出賬號關閉該提醒", "129": "雲端數據已經損壞,請參考這裡解決該問題", - "130": "TODO", + "130": "正在啟動新版本安裝程序...", "131": "TODO", "132": "TODO", "133": "TODO", diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json index 3ef450075..5efa91752 100644 --- a/app/appearance/langs/zh_CN.json +++ b/app/appearance/langs/zh_CN.json @@ -947,7 +947,7 @@ "127": "订阅距过期还剩 [%d] 天,过期后云端数据会被彻底删除。续订请访问这里,如果不需要续订,请登出账号关闭该提醒", "128": "订阅已经过期,过期后云端数据会被彻底删除。续订请访问这里,如果不需要续订,请登出账号关闭该提醒", "129": "云端数据已经损坏,请参考这里解决该问题", - "130": "TODO", + "130": "正在启动新版本安装程序...", "131": "TODO", "132": "TODO", "133": "TODO", diff --git a/app/installer.nsh b/app/installer.nsh index 524d29dc8..6b32623fb 100644 --- a/app/installer.nsh +++ b/app/installer.nsh @@ -3,7 +3,6 @@ Caption "${PRODUCT_NAME} ${VERSION}" !macro preInit nsExec::Exec 'TASKKILL /F /IM "SiYuan.exe"' nsExec::Exec 'TASKKILL /F /IM "SiYuan-Kernel.exe"' - nsExec::Exec 'TASKKILL /F /IM "SiYuan Kernel.exe"' !macroend !macro customInstallMode diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index e244f31fa..38d87504d 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -9,6 +9,7 @@ import {hideMessage, showMessage} from "./message"; import {Dialog} from "./index"; import {isMobile} from "../util/functions"; import {confirmDialog} from "./confirmDialog"; +import {getCurrentWindow} from "@electron/remote"; export const lockFile = (id: string) => { const html = `
@@ -110,8 +111,16 @@ export const exitSiYuan = () => { execInstallPkg: 2 // 0:默认检查新版本,1:不执行新版本安装,2:执行新版本安装 }, () => { /// #if !BROWSER - ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSETRAY); - ipcRenderer.send(Constants.SIYUAN_QUIT); + // 桌面端退出拉起更新安装时有时需要重启两次 https://github.com/siyuan-note/siyuan/issues/6544 + // 这里先将主界面隐藏 + setTimeout(() => { + getCurrentWindow().hide(); + }, 2000); + // 然后等待一段时间后再退出,避免界面主进程退出以后内核子进程被杀死 + setTimeout(() => { + ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSETRAY); + ipcRenderer.send(Constants.SIYUAN_QUIT); + }, 4000); /// #endif }); }, () => { diff --git a/kernel/model/conf.go b/kernel/model/conf.go index 439ce265a..52c5b9af1 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -429,12 +429,10 @@ func Close(force bool, execInstallPkg int) (exitCode int) { go func() { time.Sleep(500 * time.Millisecond) if waitSecondForExecInstallPkg { - time.Sleep(2 * time.Second) - if gulu.OS.IsWindows() { - // Windows 端退出拉起更新安装时有时需要重启两次 https://github.com/siyuan-note/siyuan/issues/6467 - // 这里多等待一段时间,等待安装程序启动后时会在 NSIS 自定义脚本中 Kill SiYuan 进程,详见 install.nsh - time.Sleep(5 * time.Second) - } + util.PushMsg(Conf.Language(130), 1000*5) + // 桌面端退出拉起更新安装时有时需要重启两次 https://github.com/siyuan-note/siyuan/issues/6544 + // 这里多等待一段时间,等待安装程序启动 + time.Sleep(4 * time.Second) } logging.LogInfof("exited kernel") util.WebSocketServer.Close()