Skip to content
⌘ NSIS Forum Archive

Sections in a if condition

4 posts

aemik#

Sections in a if condition

Hello,

I want something like this:

${If} $showsection == true
  Section "mySection"
  .
  .
  . 
  SectionEnd
${EndIf} 

But i cant compile it because ${If} is not valid outside functions...

Need help
thanks
aemik
Yathosho#
if you want this to be conditional on compilation, you can use !if. for conditions on runtime, have a look at this (or this example)
demiller9#
On the other hand, if you want it to be conditional upon some file/registry on the target machine, put code in the onInit function to hide the section.

To hide a section, you can change the section text to an empty string, or put a "-" in the front of the section string.