I'm using MUI. I've defined a custom page that reads from an INI file, to determine whether tar is located in the chosen directory.
My problem is that when the user clicks "cancel" on the custom page, the installation won't stop unless the condition is met that tar is located in the chosen directory. As I've done it below - defining a MUI_CUSTOMFUNCTION_ABORT funtion that just issues a "quit" command - the installation won't abort until the user clicks "next".
Here're (what I think are) the relevant code snippets:
!define MUI_CUSTOMFUNCTION_ABORT "FunctionName"
...
Page custom FindingTarPage
Page components
Page instfiles
...
Function FindingTarPage
!insertmacro MUI_HEADER_TEXT "$(FINDTAR_TITLE)" "$(FINDTAR_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "FindTar"
!insertmacro MUI_INSTALLOPTIONS_READ $locOfTar "FindTar" "Field 2" "State"
IfFileExists $locOfTar\tar.exe +3 0
MessageBox MB_OKCANCEL "tar.exe is not present in that directory. Try again, or press cancel to exit the installer." IDOK -4 IDCANCEL 0
Quit
FunctionEnd
Function FunctionName
Quit
FunctionEnd