Prev Previous Post   Next Post Next
Old 8th October 2013, 12:07   #1
Smurge
Junior Member
 
Join Date: Apr 2008
Posts: 21
SectionIsSelected, unknown variable

Hello

I try to use the "SectionIsSelected" macro from the logiclib.nsh, but it seems not to work with Sections that appear below the IF function.

In my example the MessageBox "g1o2_unselected" never appear. The compiler returns the warning:
unknown variable/constant "{g1o2}" detected, ignoring (macro:_SectionFlagIsSet:2)

So it appears that this IF only work when it is bellow the dependent section.
Is this a limitation of the SectionIsSelected macro? Is there a workaround?

Any help is appreciated

HTML Code:
!include "Sections.nsh"
!include "logiclib.nsh"

;--------------------------------
Name "Section Selected"
OutFile "section_selected.exe"
RequestExecutionLevel user
;--------------------------------
; Pages
Page components
Page instfiles
;--------------------------------
; Sections

Section !Required
  SectionIn RO
SectionEnd

Section "Group 1 - Option 1" g1o1
	
${If} ${SectionIsSelected} ${g1o2}
MessageBox MB_OK g1o2_selected
${Else}
MessageBox MB_OK g1o2_unselected
${EndIf}

SectionEnd


Section /o "Group 1 - Option 2" g1o2
	
${If} ${SectionIsSelected} ${g1o1}
MessageBox MB_OK g1o1_selected
${Else}
MessageBox MB_OK g1o1_unselected
${EndIf}

SectionEnd
Smurge is offline   Reply With Quote
 
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