![]() |
#1 |
Junior Member
Join Date: Feb 2014
Posts: 7
|
![]()
Hello,
I read that an NSIS installer will prevent a Windows restart to happen while the script is running, returning FALSE to WM_QUERYENDSESSION. But I wasn't able to find what happens when the installer runs in SILENT mode. Does anybody know certainly what happens if a reboot is launch (by external causes) while a SILENT install is running? If the reboot isn't prevented, is there some way to get that? Thank you. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
It will not block a reboot because there is no window to handle WM_QUERYENDSESSION. If you need to do this you can create a hidden window which handles WM_QUERYENDSESSION. It would need to be in a plug-in.
Edit: This could be a useful plug-in so I might write it at some point. Additional features could be to use the ShutdownBlockReasonCreate/ShutdownBlockReasonDestroy APIs on Windows Vista+ and to add a function to allow a shutdown/reboot (I think I already wrote a plug-in for this bit but it is very old). Stu |
![]() |
![]() |
![]() |
#3 |
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Not quite sure, but Console and Service applications can receive a WM_QUERYENDSESSION notification trough a handler routine registered via SetConsoleCtrlHandler(). Could it work with applications that don't actually have a console attached?
![]() My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
![]() |
![]() |
![]() |
|
Tags |
reboot, restart, silent, wm_queryendsession |
Thread Tools | Search this Thread |
Display Modes | |
|
|