treaz
8th January 2003 22:21 UTC
User Input Help
Hi,
I have read through several examples in the forum, however, I still dont seem to be able to apply to my case.
I have been able to create a new dialog box with textboxes for the user to input. However, I do not know how to get the user's input and write it into another file (which will be installed/copied by the installer into the target machine).
I would be great if there is a short and sweet example. Thanks!
rainwater
8th January 2003 23:58 UTC
If you are using install options, just read the "Text" field from field in ini file. The text field in the ini file will automatically updated after the user hits the next button.
kichik
9th January 2003 12:54 UTC
IO changes the State field, not the Text field.
treaz
9th January 2003 15:06 UTC
If this is the case may I know if there is any way I could read the user's text input?
Thanks!
Originally posted by kichik
IO changes the State field, not the Text field.
kichik
9th January 2003 15:33 UTC
Yes, with ReadIniStr.
treaz
9th January 2003 21:36 UTC
Could anyone please point out to me where I could have gone wrong?
Basically I am trying to read a user input and then write it to a file. BUT after the installation if complete, the file that I write to just has my variable = instead of my variable = myList. Can anyone help? Thanks!
This is part of my code:
!define TEMP2 $R1
Section -open
FileOpen $0 $INSTDIR\myfile.txt w
ReadINIStr ${TEMP2} test.ini "Field 2" "State"
FileWrite $0 "my variable = ${TEMP2} $\r$\n"
FileClose $0
SectionEnd
This is part of my test.ini file:
[Field 2]
Type=droplist
ListItems=myList
State=myList
MinLen=1
Left=30
Right=300
Top=80
Bottom=300
kichik
9th January 2003 21:48 UTC
Are you sure you got the real path to test.ini? I think it's in $PLUGINGSDIR, it must be if you are using it right. Give it a full path ($PLUGINSDIR\test.ini) and it should work.
treaz
9th January 2003 21:55 UTC
thanks!! it helped! :)