Archive: looping and installoptions


looping and installoptions
  http://forums.winamp.com/showthread....85#post1034685

This thread details some looping using installoptions. Unfortunately this person does not appear to be using the Modern UI, or at least is calling the InstallOptions DLL.

I am using MUI and custom pages, and I'm having a problem looping.

I have a text field which takes an email address in a custom page:

Function SetCustomEnterEmail

!insertmacro MUI_HEADER_TEXT "Email Validation"
"Email validation is required to complete the installation."
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "emailpage.ini"
!insertmacro MUI_INSTALLOPTIONS_READ $${EMAIL} "emailpage.ini" "Field 1" "State"
However I then process the email address and use it to access a webpage (as you might have seen before in some of my posts).

The processing part is working fine, however I'm not sure how to loop back when I process that the email is invalid. I've tried doing it all inside the main section, but using "Call SetCustomEmailPage" results in very strange behavior.

I've tried moving everything into the custom page function, and using calls to check the internet connection and the email, but then i run into a problem.

Everything seems to work OK, but when you try to use the cancel button from the custom page I get the MUI_ABORTWARNING but then it goes and processes another function call and never exits.

Has anyone had experience using MUI and InstallOptions and looping around conditionally?

If you update NSIS to the latest version you should use the new leave function of the custom pages to do the processing and then if the email address is invalid simply call abort to prevent the installer from displaying the next page. It also removes the need to check for the return values from IO dll.

Vytautas


I am using the latest version of NSIS (2.0b3?) but I didn't see anything in the docs about the custom page leave function.


By latest version I meant NSIS 2.0b4 CVS. It is actually more stable than 2.0b3, its only waiting for a few more translations before becoming a non CVS version.

Vytautas


hm... is there a compiled version of it somewhere? :)


Yes, in CVS...


You can also use the NSIS Update program with the third option to download the newest version.

Vytautas