Old 7th March 2004, 06:38   #1
amlsydney
Junior Member
 
Join Date: Mar 2004
Location: Sydney Australia
Posts: 2
Syntax clarification re Section and SectionGetFlags

Syntax example for anyone trying to control actions based on component selection:

This example does not use MUI.

Given a section declared like this:

Section "ISAPI (win32) interface" IDX201
...
SectionEnd

Use syntax like this to get the section flags:

SectionGetFlags ${IDX201} $2

Display all your flags like this:

IntFmt $5 "%08X" $2
MessageBox MB_OK|MB_ICONINFORMATION "section flags $5"

Use code like this to test whether section is selected:

IntOp $2 $2 & 0x0001
IntCmp $2 0x0001 Finish

Thanks NSIS for a fantastic installer.
amlsydney is offline   Reply With Quote
Old 7th March 2004, 07:52   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Using the Sections.nsh macros is way easier
Joost Verburg is offline   Reply With Quote
Old 7th March 2004, 08:49   #3
amlsydney
Junior Member
 
Join Date: Mar 2004
Location: Sydney Australia
Posts: 2
Part of the reason I posted the example is because I couldn't find any place that showed both the section definition and the SectionGetFlags in the same place, and I kept misunderstanding the exact syntax of the section index - how it was automatically defined.

Once the syntax is understood, other usages of it start to make sense.
amlsydney is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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