Archive: SectionGetFlags or macro SectionFlagIsSet


SectionGetFlags or macro SectionFlagIsSet
I know this is asked before and I tried the given solutions in the wike and forum but somehow don't get it to work. I really find this confusing :(

How to skip my page based on a section selection??

One question in addition at what time am I allowed to test for selections. Eg if I have 3 custom pages that come after component selection can I test before opening the 3th or must it be done right after leaving components page?



outfile "testcase.exe"

!include XPUI.nsh
!define xpui_skin "windows xp"

name testcase
!insertmacro MUI_LANGUAGE "English"

!include "Sections.nsh"

SectionGroup /e "!Section Group"
Section "Section 0" SEC00
SetOutPath "$INSTDIR"
SectionEnd
Section "Section 1" SEC01
SetOutPath "$INSTDIR"
SectionEnd
Section "Section 2" SEC02
SetOutPath "$INSTDIR"
SectionEnd
SectionGroupEnd

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC00} "Section text for 00"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Section text for 01"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Section text for 02"
!insertmacro MUI_FUNCTION_DESCRIPTION_END

!insertmacro MUI_PAGE_COMPONENTS


Page custom "initcustom"

Function initcustom

; SectionGetFlags ${SEC00} $R0
; IntOp $R0 $R0 & ${SF_SELECTED}
; IntCmp $R0 ${SF_SELECTED} show

!insertmacro SectionFlagIsSet ${SEC00} ${SF_SELECTED} Show +1

Abort

show:
!insertmacro XPUI_INSTALLOPTIONS_EXTRACT "test.ini"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "test.ini" "Field 2" "ListItems" "$R2"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "test.ini" "Field 8" "ListItems" "$R3"
!insertmacro XPUI_INSTALLOPTIONS_DISPLAY "test.ini"
FunctionEnd


You are using the macro incorrectly. You shouldn't use relative jumps with macros. You should use a label. Macros contain many commands, not just one.


Thank you!!!

I'll never forget that what a bummer ;-)