Reference/.onInit: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
(Created page with "=.onInit= This callback will be called when the installer is nearly finished initializing. If the '.onInit' function calls Abort, the installer will quit ins...") |
|||
Line 19: | Line 19: | ||
NoAbort: | NoAbort: | ||
FunctionEnd</highlight-nsis> | FunctionEnd</highlight-nsis> | ||
[[Category:Callback Functions]] |
Revision as of 15:35, 27 November 2011
.onInit
This callback will be called when the installer is nearly finished initializing. If the '.onInit' function calls Abort, the installer will quit instantly.
Here are two examples of how this might be used:
Function .onInit MessageBox MB_YESNO "This will install. Continue?" IDYES NoAbort Abort ; causes installer to quit. NoAbort: FunctionEnd
or:
Function .onInit ReadINIStr $INSTDIR $WINDIR\wincmd.ini Configuration InstallDir StrCmp $INSTDIR "" 0 NoAbort MessageBox MB_OK "Windows Commander not found. Unable to get install path." Abort ; causes installer to quit. NoAbort: FunctionEnd