I have an installer that I am creating that asks the user to input two text fields using an installoptions custom page.
I am trying to get the installer to check if the fields are empty and then display an error message if either or both are empty. I have managed to get this to work using the following code for one of the text fields but how can i get it to check both of them?
;Page5
Page custom page5 ValidateCustom
Function page5
!insertmacro MUI_HEADER_TEXT "Folders" "Please share folders out and set share names here"
#Display the page
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "page5"
!insertmacro MUI_INSTALLOPTIONS_READ $1 "page5" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $2 "page5" "Field 3" "State"
FunctionEnd
Function ValidateCustom
!insertmacro INSTALLOPTIONS_READ $1 "page5" "Field 2" "State"
!insertmacro INSTALLOPTIONS_READ $2 "page5" "Field 3" "State"
StrCmp $1 "" 0 +3
MessageBox MB_ICONEXCLAMATION|MB_OK "Please enter your name."
Abort
FunctionEnd