View Full Version : condition sections based on target machine
digitect
29th March 2003, 05:21
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, 10:56
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, 03:56
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. ;)
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.