digitect
29th March 2003 06:21 UTC
condition sections based on target machine
Is it possible to display or omit a particular section based on the target environment? I'd like to diplay a component only if the user has a certain environmental variable and that variable is a directory.
Thanks.
--
Steve Hall [ digitect@mindspring.com ]
kichik
29th March 2003 11:56 UTC
Yes, set it's name to an empty string ("") using SectionSetText. For example:
Section "Only on XP" XPSection
# ....
>SectionEnd
>Function .onInit
# get OS into $0
StrCmp $0 "XP" +3
SectionSetText${XPSection} ""
SectionSetFlags ${XPSection} 0 # unselect section
>FunctionEnd
>
digitect
30th March 2003 04:56 UTC
Thanks for the reply, the short version is that it worked.
The long version involves me spending hours and hours to get it to do so, finally realizing that functions must follow sections. ;)