Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 29th March 2003, 05:21   #1
digitect
Junior Member
 
Join Date: Mar 2003
Posts: 2
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 ]
digitect is offline   Reply With Quote
Old 29th March 2003, 10:56   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,336
Yes, set it's name to an empty string ("") using SectionSetText. For example:

PHP Code:
Section "Only on XP" XPSection
  
# ....
SectionEnd

Function .onInit
  
# get OS into $0
  
StrCmp $"XP" +3
    SectionSetText 
${XPSection""
    
SectionSetFlags ${XPSection# unselect section
FunctionEnd 

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 30th March 2003, 03:56   #3
digitect
Junior Member
 
Join Date: Mar 2003
Posts: 2
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.
digitect is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump