- NSIS Discussion
- 2 textfields
Archive: 2 textfields
Prinz
12th January 2003 16:41 UTC
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!
kichik
12th January 2003 18:15 UTC
There is currently no other option than checking the INI file after IO exits and call it again if needed.
cybereka
14th March 2003 07:14 UTC
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.
deguix
14th March 2003 07:33 UTC
Please attach the script file.
cybereka
14th March 2003 08:03 UTC
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
deguix
14th March 2003 08:10 UTC
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:\Pathhow 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=5Left=65
Right=108
Top=1
Bottom=13
cybereka
14th March 2003 08:35 UTC
Is the State path is for the inifile.ini whether its a different file or the same file in which i specified the textboxes
deguix
14th March 2003 08:46 UTC
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).
cybereka
14th March 2003 09:26 UTC
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.
Joost Verburg
14th March 2003 09:27 UTC
The Modern UI uses the plugins directory.
You should use:
!insertmacro MUI_INSTALLOPTIONS_READ $0 "License.ini" "Field 2" "State"
instead of ReadINIStr
cybereka
14th March 2003 09:48 UTC
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.
cybereka
14th March 2003 09:54 UTC
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
Joost Verburg
14th March 2003 09:55 UTC
Nope. You will have to modify the InstallOptions sorce, or use one textbox.
kichik
15th March 2003 11:34 UTC
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
>