How to recall script variables

Anonymous user
How to recall script variables

Sorry for the trivial question but I'm trying to make a NSIS script for the first time. My problem is the way in which I can recall the variables of the generated dialog in main NSIS script (eg in a textbox I have a value how can I use this value in the nsi script?)

Sorry for the very trivial question

Thanks, Giulio

Posts: 1497
Joined: 25 Mar 2012 - 01:19
Set/Get control text

http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html#mref-gettext

Suppose you added a TextBox to a dialog, the generated script is this:

; === TextBox1 (type: Text) ===
${NSD_CreateText} 8u 69u 66u 11u "foo"
Pop $hCtl_Form1_TextBox1

To read/set the value into your variable:

Var myVar
${NSD_GetText} $hCtl_Form1_TextBox1 $myVar
${NSD_SetText} $hCtl_Form1_TextBox1 "bar"

Official nsDialog reference page: http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html