瀏覽代碼

changes(nsis): move pre hooks before kill app (#10271)

Tony 1 年之前
父節點
當前提交
9f0a5fceac
共有 2 個文件被更改,包括 9 次插入4 次删除
  1. 5 0
      .changes/nsis-pre-hooks-timing.md
  2. 4 4
      tooling/bundler/src/bundle/windows/templates/installer.nsi

+ 5 - 0
.changes/nsis-pre-hooks-timing.md

@@ -0,0 +1,5 @@
+---
+"tauri-bundler": "patch:changes"
+---
+
+Make `NSIS_HOOK_PREINSTALL` and `NSIS_HOOK_PREUNINSTALL` run before `CheckIfAppIsRunning` (which checks if the app is running and asks the user if they want to kill the app)

+ 4 - 4
tooling/bundler/src/bundle/windows/templates/installer.nsi

@@ -556,12 +556,12 @@ SectionEnd
 Section Install
   SetOutPath $INSTDIR
 
-  !insertmacro CheckIfAppIsRunning
-
   !ifmacrodef NSIS_HOOK_PREINSTALL
     !insertmacro NSIS_HOOK_PREINSTALL
   !endif
 
+  !insertmacro CheckIfAppIsRunning
+
   ; Copy main executable
   File "${MAINBINARYSRCPATH}"
 
@@ -683,12 +683,12 @@ FunctionEnd
 
 Section Uninstall
 
-  !insertmacro CheckIfAppIsRunning
-
   !ifmacrodef NSIS_HOOK_PREUNINSTALL
     !insertmacro NSIS_HOOK_PREUNINSTALL
   !endif
 
+  !insertmacro CheckIfAppIsRunning
+
   ; Delete the app directory and its content from disk
   ; Copy main executable
   Delete "$INSTDIR\${MAINBINARYNAME}.exe"