View Full Version : getting data
darshanaltekar
27th February 2007, 14:22
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.
Red Wine
27th February 2007, 14:33
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_and_Writing_the_Registry_-_NSIS_makes_it_easy
darshanaltekar
28th February 2007, 09:31
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 "
Red Wine
28th February 2007, 09:41
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
darshanaltekar
28th February 2007, 09:59
but will this code change value of "state" at runtime ie depending upon user selection
i'm trying it but i'm still struglling
Red Wine
28th February 2007, 10:58
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...
Comperio
1st March 2007, 04:11
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.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.