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

This commit is contained in:
Tony 2024-07-15 19:54:02 +08:00 committed by GitHub
parent d1df6be701
commit 9f0a5fceac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View File

@ -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)

View File

@ -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"