Archive: leave function not called with custom page


leave function not called with custom page
Hello,

I adapted the nsis install script of OpenVPN-GUI to make it a bit less complicated to install. I now need to include a custom page where the usercan type the name of an admin account.

I created the custom page according to the MUI rules:

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${HOME}\install-win32\license.txt"
; Custom page to set the admin user
Page custom GetAdminUser SetAdminUser

; CUSTOM PAGE
Function GetAdminUser
; set title
!insertmacro MUI_HEADER_TEXT "$(ADMINUSER_TITLE)" "$(ADMINUSER_SUBTITLE)"
; Display the page.
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "NSIS_adminUser.ini"
FunctionEnd

Function SetAdminUser
MessageBox MB_OK "SetAdminUser"
; Get the user entered values.
!insertmacro MUI_INSTALLOPTIONS_READ $ADMIN_USER "NSIS_adminUser.ini" "Field 1" "State"
MessageBox MB_OK "Value: $ADMIN_USER"
FunctionEnd

And the line in the onInit.

The dialog shows and I can type in the box, but when I click the install button (BTW can I rename this to Next?) nothing happens.

I used the same code in one of my own scripts and that worked without a problem.

Any clou's

- Remi -


A couple of questions plz,
which is the installed NSIS version on the system where compiling this script?
Is there any warning in compiler's log?

You may change the text of the button, just edit the NSIS_adminUser.ini, under settings section add NextButtonText=Next >


The NSIS version is 2.23 and I don't get any warnings.


I couldn't reproduce the issue, neither I could find a reason or something in the log that causes it :(


What's in the INI file? There may be some fields that don't pass validation.


Originally posted by kichik
What's in the INI file? There may be some fields that don't pass validation.
Yeah! now I got it!
If for instance the MinLen is set but the ValidateText isn't set, then when input is less than the MinLen requirement the ValidateText error message does not appear!

I'll check the ini and post back


That was the problem!!!
Thanks.