Archive: Prompting for a directory


Prompting for a directory
I have 2 different sections on the components page, if the user has section 2 selected i need to prompt them to enter a directory, but not if they only have section 1 selected.
I know how to use page directory and installoptions to prompt for a directory, but how do i make them only appear if the user has section 2 selected? Using "InstallOptions::dialog "$PLUGINSDIR\FDSDir.ini"" in the section does bring up the dialog, but all the buttons are greyed out and you cant do anything.
I searched and couldnt find the answer to this on the forums or the wiki.


!include Sections.nsh

!insertmacro MUI_PAGE_DIRECTORY

!define MUI_PAGE_CUSTOMFUNCTION_PRE Directory2Pre
!insertmacro MUI_PAGE_DIRECTORY

Section "Section 2" Sec2

SectionEnd

Function Directory2Pre
SectionGetFlags ${Sec2} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} +2
Abort
FunctionEnd


-Stu