Skip to content

Commit 45a0f82

Browse files
authored
feat(nsis): add ShutdownBlockReasonCreate for blocking Win Shutdown prompt (#7251)
Use ShutdownBlockReasonCreate show better message why shutdown is blocked
1 parent 37c2615 commit 45a0f82

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/olive-planets-grin.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": minor
3+
---
4+
5+
feat(nsis): add ShutdownBlockReasonCreate for blocking Windowns Shutdown alert/prompt

packages/app-builder-lib/templates/nsis/installSection.nsh

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ StrCpy $appExe "$INSTDIR\${APP_EXECUTABLE_FILENAME}"
2626
FindWindow $0 "#32770" "" $hwndparent $0
2727
GetDlgItem $0 $0 1000
2828
SendMessage $0 ${WM_SETTEXT} 0 "STR:$(installing)"
29+
30+
StrCpy $1 $hwndparent
31+
System::Call 'user32::ShutdownBlockReasonCreate(${SYSTYPE_PTR}r1, w "$(installing)")'
2932
${endif}
3033
!insertmacro CHECK_APP_RUNNING
3134
!else
@@ -104,4 +107,4 @@ ${endIf}
104107
${andIf} ${Silent}
105108
!insertmacro doStartApp
106109
${endIf}
107-
!endif
110+
!endif

0 commit comments

Comments
 (0)