Skip to content

Commit

Permalink
changes(nsis): move pre hooks before kill app (#10271)
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master authored Jul 15, 2024
1 parent d1df6be commit 9f0a5fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changes/nsis-pre-hooks-timing.md
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 4 additions & 4 deletions tooling/bundler/src/bundle/windows/templates/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 9f0a5fc

Please sign in to comment.