Archive: Back to previous page during installation


Back to previous page during installation
Hi,
I am not sure if this question has been posted before.
If it is linked to some other past questions, pls do lead me to them.

Scenerio:
The user makes and input on one page and clicks NEXT.
The installer would then validate the user's input.
If the input is valid, then installer would proceed to the install page.
Otherwise, the installer would go back to the page where the user has to re-enter his input.

I would greatly appreciate it if someone could help on this.
An example would be great.

Thanks.


Use the ValidateText field of IO. Read the IO readme for more information about it (ValidateText, MaxLen and MinLen).


Please pardon my ignorance, I was reading through the example given in IO. But I do not understand much about it at all. Could someone pls explain with comments of what each statement with ;?? does?

I would also like to know how do I make use of the InstallOptions for my installer which already has some useful functions incoporated? (What statements do I need to include in my own script to use InstallOptions?)

Thanks in advance.

Example in IO:
InstallOptions::initDialog /NOUNLOAD file.ini Pop $0;is file.ini my own ini file??
IntCmp $0 0 error
; $0 is now the IO dialog HWND
; use getdlgitem with it and sendmessage
GetDlgItem $1 $0 1200 ; 1200 + field number - 1 ;what is field number and what does this statement do??

; $1 is now the HWND of the first field
CreateFont $2 "Tahoma" 10 700
SendMessage $1 ${WM_SETFONT} $2 0 ;??

InstallOptions::show
Pop $0
StrCmp $0 "success" done
StrCmp $0 "back" done
StrCmp $0 "cancel" done
error:
MessageBox MB_OK|MB_ICONSTOP "IO error: $0"
Quit
done:


; just start a comment. A comment, is a comment, doesn't do anything.

Take a look at the simpler example first, test.nsi and test.ini. ValidateText, MaxLen and MinLen should be in the INI.

If you are using the Modern UI have a look at the MUI example InstallOtpions.nsi in Examples\Modern UI.

I am sure this is not enough, but alas, my time is up. I will come back for more information tomorrow.

Good night.


Hi,
I guess my question was not structured that well therefore there is a mis-interpretation.

I was using those comments in red to ask my questions.

Maybe I should use a totall different approach:
Could someone tell me what does the below statements do?

1) GetDlgItem $1 $0 1200
2) SendMessage $1 ${WM_SETFONT} $2 0

May I also know how does this work such that it allows the user to go back to the previous page to re-enter his inputs?

Please note that my validation is not simple text validating. Therefore, using ValidateText does not work.

I hope I am clear this time. Apologise for the bad language.


GetDlgItem gets the handle of a control in a dialog. In this case it gets the handle of the first field of the dialog created by IO (Field 1). You can use the HWND (window handle) to send the control messages such as WM_SETFONT, hide or show it, and set its background color using SetStaticBkColor (only if it's a label).

The WM_SETFONT message sets the font of the control associated with the HWND inside $1.

You don't need all of this for what you are trying to do. In fact, you don't even need initDialog and showDialog, only dialog.

After you call InstallOptions::dialog and it returns "success" (pushes it on the stack and you get it using Pop) you should read the INI file, verify that everything is right and if not call InstallOptions::dialog again and possibly add an error label or pop up a message box stating what's wrong with the input.

I have recently written an example for NsisMan of an IO page that gets the user name and info and then verifies it. The example is in this thread: http://forums.winamp.com/showthread....light=password


Thanks!
Got the problem solved with your example.
:)