Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix(windows): align NSIS process checks with Tauri 2.12

hairyff2ad9d8bbb30
diff --git a/src-tauri/templates/installer.nsi b/src-tauri/templates/installer.nsi
index 3c9ed486..3cd136f3 100644
--- a/src-tauri/templates/installer.nsi
+++ b/src-tauri/templates/installer.nsi
@@ -37,6 +37,7 @@ ManifestDPIAwareness PerMonitorV2
!include "FileAssociation.nsh"
!include "Win\COM.nsh"
!include "Win\Propkey.nsh"
+!include "Win\RestartManager.nsh"
!include "StrFunc.nsh"
${StrCase}
${StrLoc}
@@ -786,7 +787,7 @@ Section Install
!insertmacro NSIS_HOOK_PREINSTALL
!endif
- !insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
+ !insertmacro CheckIfAppIsRunning "$INSTDIR\${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
; Copy main executable
File "${MAINBINARYSRCPATH}"
@@ -945,7 +946,7 @@ Section Uninstall
!insertmacro NSIS_HOOK_PREUNINSTALL
!endif
- !insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
+ !insertmacro CheckIfAppIsRunning "$INSTDIR\${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
; Delete the app directory and its content from disk
; Copy main executable
diff --git a/test/msi-upgrade-path.test.ts b/test/msi-upgrade-path.test.ts
index 251735aa..9c61ec51 100644
--- a/test/msi-upgrade-path.test.ts
+++ b/test/msi-upgrade-path.test.ts
@@ -58,6 +58,12 @@ it('stable MSI removes only the three old renamed shortcuts on a major upgrade',
describe('nsis upgrade discovery', () => {
const source = readFileSync(new NodeURL('templates/installer.nsi', tauriRoot), 'utf8')
+ it('loads RestartManager and checks the installed executable path for install and uninstall', () => {
+ expect(source).toMatch(/^!include "Win\\RestartManager\.nsh"\r?$/m)
+ expect([...source.matchAll(/^\s*!insertmacro CheckIfAppIsRunning (.+)$/gm)].map(match => match[1]))
+ .toEqual(Array.from({ length: 2 }).fill(`"$INSTDIR\\\${MAINBINARYNAME}.exe" "\${PRODUCTNAME}"`))
+ })
+
it('reads the old github install directory only for stable when the current key is empty', () => {
const read = source.match(/^Function ReadPreviousInstallLocation\r?\n([\s\S]*?)^FunctionEnd/m)?.[1]
expect(read).toMatch(/ReadRegStr \$4 SHCTX "\$\{MANUPRODUCTKEY\}" ""\s+!if "\$\{BUNDLEID\}" == "dsh-tauri"\s+\$\{If\} \$4 == ""\s+ReadRegStr \$4 SHCTX "Software\\github\\\$\{REGISTRYPRODUCTNAME\}" ""\s+\$\{EndIf\}\s+!endif/)