You can create callback functions which have special names, that will be called by the installer at certain points in the install. Below is a list of currently available callbacks:
This callback will be called when the installer is nearly finished initializing. If the '.onInit' function calls \R{abort}{Abort}, the installer will quit instantly.
This callback is called when the user hits the 'cancel' button after the install has failed (if it could not extract a file, or the install script used the \R{abort}{Abort} command).
This callback is called when the install was successful, right before the install window closes (which may be after the user clicks 'Close' if \R{aautoclosewindow}{AutoCloseWindow} or \R{setautoclose}{SetAutoClose} is set to false).
This callback is called whenever the mouse position over the sections tree has changed. This allows you to set a description for each section for example. The section id on which the mouse is over currently is stored, temporarily, in $0.
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.
Called when the selection changes on the \R{pages}{component page}. Useful for using with \R{sectionsetflags}{SectionSetFlags} and \R{sectiongetflags}{SectionGetFlags}.
This callback is called when the user hits the 'cancel' button, and the install hasn't already failed. If this function calls \R{abort}{Abort}, the install will not be aborted.
This callback enables control over whether or not an installation path is valid for your installer. This code will be called every time the user changes the install directory, so it shouldn't do anything crazy with \R{messagebox}{MessageBox} or the likes. If this function calls \R{abort}{Abort}, the installation path in $INSTDIR is deemed invalid.
This callback will be called when the uninstaller is nearly finished initializing. If the 'un.onInit' function calls Abort, the uninstaller will quit instantly. Note that this function can verify and/or modify $INSTDIR if necessary.
Here are two examples of how this might be used:
\c Function un.onInit
\c MessageBox MB_YESNO "This will uninstall. Continue?" IDYES NoAbort
This callback is called when the user hits the 'cancel' button after the uninstall has failed (if it used the \R{abort}{Abort command} or otherwise failed).
This callback is called when the uninstall was successful, right before the install window closes (which may be after the user clicks 'Close' if \R{setautoclose}{SetAutoClose} is set to false)..
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.
Called when the selection changes on the \R{pages}{component page}. Useful for using with \R{sectionsetflags}{SectionSetFlags} and \R{sectiongetflags}{SectionGetFlags}.
Selection changes include both section selection and installation type change.
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.