Archive: conditional sections


conditional sections
hello,

please forgive me, if this has been asked often already - I've tried to search but found nothing helpful.

My installerproject is for installing a plugin for several possible programms. Therefore it will install some common files in anycase. The installer reads the registry to check if supported programms are installed and now I would like to hide or at least disable section for those programms which are not installed at the users computer.

Therfore I have created the program sections like


Section /o "Prg1" SeccPrg1
...


and in a callback I try to activate or disable it

!insertmacro SelectSection "Prg1"
...
!insertmacro SetSectionFlag "Prg1" ${SF_RO}


I use the ModernUI.

The problem is that I've not been able to achive any results. I can add MsgBoxes to see that checking for the programm works, but nothing changes in the state of the commponent selection.

Could one please point me to a working example of an installer that changes the component selection, based on run-time criteria.

Shouldn't it be...

!insertmacro SelectSection ${SeccPrg1}
...
!insertmacro SetSectionFlag ${SeccPrg1} ${SF_RO}


?

-Stu

I've tried that, but then I got
[code}
unknown variable/constant "{SeccPrg1}" detected, ignoring (macro:SelectSection:3)
[/code]

I now moved my function definition around and after I've putted it quite below in the code, it started to work.

Many thanks!