How to recall script variables

Please let our ADS show!

This sites offers only FREE software and it's supported by a few advertisement boxes (no intrusive popups).
Please:

  • disable your AdBlocker by adding CoolSoft website to whitelist
  • give the proper cookie consent
  • enable JavaScript for this website

This seconds wait is to let you update your browser configuration...

Ok, I've done the required changes... now show me your content!
!!! Please enable JavaScript !!!
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: 1972
Joined: March 25, 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