Skip to content
⌘ NSIS Forum Archive

Required components based on conditions

3 posts

ElArZ#

Required components based on conditions

Hi,

What i want to do is be able to choose whether a section in the components page should be required or not based on a condition.

I can't put the section block inside an if statement and i couldn't find a way to change the state of a component from normal to required (and vice-versa) from within a function.

Could someone propose a solution or at least point me in the right direction?

Thank you.
Red Wine#
There are the section management instructions to go with, and to make things easier there's also the included header sections.nsh.
Probably in function .onInit I would check the condition's true/false state and regarding to that I would set sections in the required state either with sections management instructions or (preferable) with sections.nsh offered commands.