Here is the code:
However, if the user hits Cancel when the incorrect directory is currently selected the "Are you sure you want to quit setup?" message box appears, which is all well and good, but when Yes is clicked the "The software is not installed in the specified directory." message box gets displayed!!
Function MainScreen1
try_again:
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "Main_Screen_1.ini"
!insertmacro MUI_INSTALLOPTIONS_READ $var_FL_INSTALL_DIR "Main_Screen_1.ini" "Field 4" "State"
IfFileExists $var_FL_INSTALL_DIR\config\policy finish not_installed
not_installed:
MessageBox MB_OK|MB_ICONSTOP "The software is not installed in the specified directory." IDOK try_again
finish:
FunctionEnd
How do I get round this? Is there a best practice way of doing this sort of thing?