made the Reboot command first quit and then reboot

- fixed bug #989690
 - the installer now denies reboots while running
 - the Reboot instruction no longer returns or sets the error flag
 - added .onRebootFailed which is called when Reboot fails
 - installer should now always clean-up when rebooting


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3729 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2004-10-14 13:56:02 +00:00
parent b5cab9b25f
commit 335fd47066
10 changed files with 100 additions and 58 deletions

View file

@ -327,7 +327,7 @@ You can also set a subcaption (or override the default) using \R{acaption}{Capti
\c text
Changes the text of the button that by default says "Uninstall" in the uninstaller. If no parameter is specified, the default text is used. See also \R{WriteUninstaller}{WriteUninstaller} (replaces UninstallEXEName).
Changes the text of the button that by default says "Uninstall" in the uninstaller. If no parameter is specified, the default text is used. See also \R{writeuninstaller}{WriteUninstaller} (replaces UninstallEXEName).
\S2{auninstallcaption} UninstallCaption

View file

@ -86,6 +86,16 @@ Example:
\c SendMessage $R0 ${WM_SETTEXT} 0 "second section description"
\c FunctionEnd
\S3{onrebootfailed} .onRebootFailed
This callback is called if \R{reboot}{Reboot} fails. \R{writeuninstaller}{WriteUninstaller}, \R{plugindlls}{plug-ins}, \R{file}{File} and \R{writeregbin}{WriteRegBin} should not be used in this callback.
Example:
\c Function .onRebootFailed
\c MessageBox MB_OK|MB_ICONSTOP "Reboot failed. Please reboot manually." /SD IDOK
\c FunctionEnd
\S3{onselchange} .onSelChange
Called when the selection changes on the \R{pages}{component page}. Useful for using with \R{sectionsetflags}{SectionSetFlags} and \R{sectiongetflags}{SectionGetFlags}.
@ -167,6 +177,16 @@ Example:
This callback is called right after the uninstaller window closes. Use it to free any user interface related plug-ins if needed.
\S3{unonrebootfailed} un.onRebootFailed
This callback is called if \R{reboot}{Reboot} fails. \R{writeuninstaller}{WriteUninstaller}, \R{plugindlls}{plug-ins}, \R{file}{File} and \R{writeregbin}{WriteRegBin} should not be used in this callback.
Example:
\c Function un.onRebootFailed
\c MessageBox MB_OK|MB_ICONSTOP "Reboot failed. Please reboot manually." /SD IDOK
\c FunctionEnd
\S3{unonuserabort} un.onUserAbort
This callback is called when the user hits the 'cancel' button and the uninstall hasn't already failed. If this function calls Abort, the install will not be aborted.

View file

@ -2,7 +2,7 @@
\S2{reboot} Reboot
Reboots the computer. Be careful with this one. If there is an error rebooting, this function sets the error flag and continues. If the reboot is successful, this instruction does not return.
Reboots the computer. Be careful with this one. If it fails, \R{onrebootfailed}{.onRebootFailed} is called. In any case, this instruction never returns, just like \R{quit}{Quit}.
\c MessageBox MB_YESNO|MB_ICONQUESTION "Do you wish to reboot the system?" IDNO +2
\c Reboot

View file

@ -1,6 +1,6 @@
\S1{uninst} Uninstaller Instructions
\S2{WriteUninstaller} WriteUninstaller
\S2{writeuninstaller} WriteUninstaller
\c [Path\]exename.exe