Archive: 2 textfields


2 textfields
  Hi,

I have 2 textfields on a custom page. One of them needs to be filled in, but not both. How to prevent going to the next page when

a) nothing is filled in
b) both are filled in

c) finally detect which one is filled in?

I've tried a lot things..but can't figure it out. :confused:

Greetz!


There is currently no other option than checking the INI file after IO exits and call it again if needed.


I need to insert a custom page which should have a text box to get a key value this i am trying out to have a license module like. So can some body say what is the procedure to insert a custom page. I checked a lot but confussed. So if any one can provide me step by step action i will be very thankful to u.


Please attach the script file.


With the help of the examples now i got inserted a page and placed 3 text boxes in it also but where will the values entered will be stored, how can i access the value and one more i want to control the textbox to take not more that five chars. Many thank for u deguix


where will the values entered will be stored
In the State of the control:

Ex.:

[Field 7]
Type=text
Left=10
Right=70
Top=1
Bottom=13
State=C:\Path

how can i access the value
Read the State of the control.

Ex.:

ReadINIStr $0 "inifile.ini" "Field 7" "State"

I want to control the textbox to take not more that five chars.
In the INI, use "MaxLen" for value name and "5" to the value of this value name.

Ex.:

[Field 1]
Type=text
MaxLen=5
Left=65
Right=108
Top=1
Bottom=13

Is the State path is for the inifile.ini whether its a different file or the same file in which i specified the textboxes


State=C:\Path

This is only an example, can be anything:

State=fsdfghsrot348509ue0sjp042q wr a[lfnsçoiuterbtnç odut58ps0948560

This will be show at the text box (or any control, if is a checkbox or radiobutton, will return 1 if enabled and 0 if disabled).


Well my ini file is named License i made a entry State for my text as State=00000 their and then in my script i ReserveFile License.ini and in .onInit function i use this !insertmacro MUI_INATALLOPTIONS_EXTRACT "License.ini" then in the start of my section i say ReadINIStr $0 "License.ini" "Field 2" "State" and try to display this in a message box but i am getting it empty what could be the problem? I follewed all those previou steps from the example provided with the kit. Sorry for this long definition even i can post my script but its too long.


The Modern UI uses the plugins directory.

You should use:

!insertmacro MUI_INSTALLOPTIONS_READ $0 "License.ini" "Field 2" "State"

instead of ReadINIStr


Yes i am getting it now but is there any way to set the focus to next text box when the user types more than the maxlen of the textbox. With lots of thanks.


One more question i am calling a C exe from the script how can i set the error flag of the script from C code. Like if i return -1 from the code will it set the error flag of the script


Nope. You will have to modify the InstallOptions sorce, or use one textbox.


One more question i am calling a C exe from the script how can i set the error flag of the script from C code. Like if i return -1 from the code will it set the error flag of the script
Use ExecWait and specify an output variable for the error code. The error code is the integer returned from the main function of your C code, or the integer passed on to ExitProcess if not using CRT (like NSIS does, ignore default libraries). For Example:


ExecWait $TEMPMyProg.exe $0

StrCmp$0 -1 error
Return
>error:
DetailPrint error
>