GoldkinG
4th February 2012 07:17 UTC
Conditions in sections for silent install
Hi,
In my installer i wan to implement the Conditions in sections for silent installation.
Pls refer the below code.
Section 1
${If} {$Condition}==A
SectionIn RO
${EndIf}
---------------
------------
SectionEnd
In the above code, If i choose Condition B, the section is in selection state in the components page. pls anyone help me..
Thanks in advance...http://forums.winamp.com/images/smilies/smile.gif
Afrow UK
4th February 2012 11:44 UTC
SectionIn is a compile time instruction. To set at run time, use the SetSectionInInstType to set install types. To make the section read only at run time, use SetSectionFlag with ${SF_RO}. These are all in Sections.nsh.
Edit: SectionIn RO does not unselect the section, it makes it read only. To unselect/select sections at run time use the SelectSection/UnselectSection macros in Sections.nsh.
Edit: And of course you must use the macros before the Sections are executed (so in .onInit for example).
Stu
GoldkinG
7th February 2012 04:27 UTC
Actually i wan to set the read only mode in sections at compile time only. This can done based on the conditions or parameters are passed by text file. In text file i change the variable name means the sections "Read only" mode will be change.
demiller9
7th February 2012 05:44 UTC
To set the section flags at compile time, you must you compile time conditionals (!if, !ifdef, !ifndef, etc). You cannot use runtime conditionals (${If}, ${Else}, etc.) at compile time.
GoldkinG
7th February 2012 10:02 UTC
Hearty thanks... It's working fine....:)