Archive: getting data


getting data
I have designed a custom page in which there is one text box & next button when user clicks next & move to next window & want to store the value entered by user in a veriable how can i do this?
also how can i identify which radio button is checked while moving to next window
Thanks in advance.


ReadINIStr $var "$PLUGINSDIR\ini_file.ini" "Field #" "State"

See included InstallOptions examples, also this wiki page might be a bit helpful,

http://nsis.sourceforge.net/Reading_..._makes_it_easy

ReadINIStr $var "$PLUGINSDIR\ini_file.ini" "Field #" "State"


i'm getting what ur trying to say but when i'm inserting baove line & checking value of var its giving me blannk

var /global state1

ReadINIStr $state1 "$PLUGINSDIR\Repair_Reinstall.ini" 'Field 2' 'State'

messagebox mb_ok " field 2 = $state1 "


showinstdetails show
outfile 'test.exe'

page custom customcreate customleave
page InstFiles
section -
sectionend

function customleave
ReadINIStr $0 "$PLUGINSDIR\custom.ini" "field 1" "state"
messagebox mb_ok "$0"
ReadINIStr $0 "$PLUGINSDIR\custom.ini" "field 2" "state"
messagebox mb_ok "$0"
functionend

function customcreate
InstallOptions::Dialog "$PLUGINSDIR\custom.ini"
pop $0
functionend

function .onInit
InitPluginsDir
WriteIniStr "$PLUGINSDIR\custom.ini" "settings" "numfields" "2"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 1" "type" "radiobutton"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 1" "left" "10"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 1" "right" "-10"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 1" "top" "10"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 1" "bottom" "22"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 1" "text" "radio button 1"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 1" "state" "1"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 1" "flags" "group"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 2" "type" "radiobutton"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 2" "left" "10"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 2" "right" "-10"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 2" "top" "30"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 2" "bottom" "42"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 2" "text" "radio button 2"
WriteIniStr "$PLUGINSDIR\custom.ini" "field 2" "state" "0"
functionend

but will this code change value of "state" at runtime ie depending upon user selection
i'm trying it but i'm still struglling


Gosh! I give up... If this small pretty clear example cannot show you the way to go, I just don't know what else to say...
Just try it...


The value of STATE gets changed in the INI file when the user clicks the control but just before the page's leave function is called. State will therefore be whatever the user chooses at runtime.

As Red Wine suggests, just try his example. And if you still need more, take a look at the InstallOptions documentation and the samples included under ${NSISDIR}\Examples\InstallOptions included with the NSIS install.