Archive: Using user input


Using user input
This is my first crack at NSIS. I'm using the modren interface. I created three custom dialog pages and I'm using them to capture data entered by the user (person installing). How do I store \ get \ access the values they entered?

My function looks like this so far:
--------------------------------------------------------------------
Function SetCustomAPPNAME
strcpy $1 "Choose APPNAME"
strcpy $2 "[PI]AppName value stored the INI file."
!insertmacro MUI_HEADER_TEXT $1 $2
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioAPPNAME.ini"
FunctionEnd
--------------------------------------------------------------------

ioAPPNAME.ini resembles:
--------------------------------------------------------------------
[Field 2]
Type=Text
MaxLen=4
MinLen=4
ValidateText=Must be 4 Characters in Length
Left=10
Right=-80
Top=65
Bottom=75
--------------------------------------------------------------------

Basically I want to capture what they enter and then use in another section like this:
-------------------------------------------------------------------
Section "INI File" SecINIFile ;Setup up INI file
WriteINIStr $INSTDIR\dat\rerout.ini "Files" "log" <USER INPUT>
SectionEnd ; end the section


Use for read:


ReadIniStr $0 $PLUGINSDIR\ioAPPNAME.ini "Field 2" State
MessageBox MB_OK "Hi $0"

To make the code clearer it would be better to use:

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

But Lobo's code should work too.


Both work. Thanks a bundle. Where's all the documentation for all the macros for the modern GUI ?


http://nsis.sourceforge.net/Docs/AppendixA.html#A
http://nsis.sourceforge.net/Contrib/...UI/Readme.html