Skip to content

Commit 9f0a5fc

Browse files
changes(nsis): move pre hooks before kill app (#10271)
1 parent d1df6be commit 9f0a5fc

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changes/nsis-pre-hooks-timing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": "patch:changes"
3+
---
4+
5+
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)

tooling/bundler/src/bundle/windows/templates/installer.nsi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,12 @@ SectionEnd
556556
Section Install
557557
SetOutPath $INSTDIR
558558

559-
!insertmacro CheckIfAppIsRunning
560-
561559
!ifmacrodef NSIS_HOOK_PREINSTALL
562560
!insertmacro NSIS_HOOK_PREINSTALL
563561
!endif
564562

563+
!insertmacro CheckIfAppIsRunning
564+
565565
; Copy main executable
566566
File "${MAINBINARYSRCPATH}"
567567

@@ -683,12 +683,12 @@ FunctionEnd
683683

684684
Section Uninstall
685685

686-
!insertmacro CheckIfAppIsRunning
687-
688686
!ifmacrodef NSIS_HOOK_PREUNINSTALL
689687
!insertmacro NSIS_HOOK_PREUNINSTALL
690688
!endif
691689

690+
!insertmacro CheckIfAppIsRunning
691+
692692
; Delete the app directory and its content from disk
693693
; Copy main executable
694694
Delete "$INSTDIR\${MAINBINARYNAME}.exe"

0 commit comments

Comments
 (0)