Archive: can't cancel from a custom page


can't cancel from a custom page
I've added a custom page to an installer, to call a function that in turn calls a DLL to check whether a selected port TCP port is open or already bound.

I want the install to stay on that page until either an open port is provided or the user uses the Cancel button to quit the installer.

I have this function partly working:


Function SetChoosePorts

choose_again:
;Set up the port config page
!insertmacro MUI_HEADER_TEXT "Manager Port and User Options" "Choose port, user and password"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "portconfig.ini"

Call configure
pop $R7
StrCmp $R7 "1" choose_again proceed

proceed:
return

FunctionEnd


Not too elegant, but I thought it was sufficient. The trouble is that when a Cancel is selected, I get the warn dialog but selecting Yes still takes me back to the page. Also, pressing Back sends me back to the loop.

How can I break out of the loop correctly?

Thanks

You should put the test code in the leave function of the page. This way, the page won't be destroyed until you don't call Abort, and you won't have to worry about recreating the page.