!include "x64.nsh"
!include "WndSubclass.nsh"
!include "WinMessages.nsh"
Function Check_Windows_Turned_OFF_Action
${If} $2 = ${WM_QUERYENDSESSION}
WriteRegStr HKLM "SOFTWARE\1" "1" "OFF"
Quit
${EndIf}
FunctionEnd
Function Check_Windows_Turned_OFF
FindWindow $0 "#32770" "" $HWNDPARENT
${WndSubclass_Subclass} $0 Check_Windows_Turned_OFF_Action $5 $5
FunctionEnd
Section
BK:
Call Check_Windows_Turned_OFF
Goto BK
SectionEnd
why when i run the loop function Check_Windows_Turned_OFF ,installer stop work and auto closed??