Skip to content
⌘ NSIS Forum Archive

CheckBoxes

6 posts

Potz#

CheckBoxes

I am wondering how to write the nsis code to check to see if a check box is checked and if it is then it would send it to another function. I am doing this for a list of programs you can install by checking a checkbox. I would think that this should be very simple but I can't find code that shows a good example.
Potz#
Thanks for the example file... Just a few more questions about this. First, is this a radio button example? and second how do .nsh files work with the .ini and the .nsi files? I am new at using nsis and I can’t really find how these 3 types of files interact.
Afrow UK#
Where is this check box? Is it on an InstallOptions dialog? If so then you need to read from the INI file with ReadINIStr. The State property of the check box field will be 0 or 1.

Why not just use Sections though and a Components page, like all the example script show?

-Stu
Potz#
Ok, I thought the check boxes would be either a 1 or a 0 for if they were check or not but I wasn't sure.

so it should look like this

ReadINIstr $1 "$PLUGINSDIR\ProInstList.ini" "Field 2" "State"

then you would check to see if $1 is equal to 1 or 0 right?

Can you give me a link to the example script that shows a checkbox? if so that would be very much appreciated 🙂