Archive: Hidden section and Subsection


Hidden section and Subsection
Hello.

If i use this code on NSIS 2.01:


Name "Test"
OutFile "C:\work\123\Test.exe"

!include "MUI.nsh"
!include "LogicLib.nsh"
SubSection "subsection1" TestSubsection1
Section '-' SEC_hidden_test1
SectionEnd
Section 'sec1' SEC_test1
SectionEnd
Section 'sec2' SEC_test2
SectionEnd
SubSectionEnd


SubSection "subsection2" TestSubsection2
Section 'sec3' SEC_test3
SectionEnd
Section 'sec4' SEC_test4
SectionEnd
SubSectionEnd

!define MUI_COMPONENTSPAGE_SMALLDESC
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH


And when on page 'MUI_PAGE_COMPONENTS' uncheck 'sec1' and 'sec2' subsection1 will uncheck. all is well. I need to be so.

But when i try this code on NSIS 2.45 and on page 'MUI_PAGE_COMPONENTS' uncheck 'sec1' and 'sec2' subsection1 becomes gray. I understand that this is happening because that use a hidden section. But how to do that hide section did not affect the subsection as in NSIS 2.01? Instead, subsection I tried to use SectionGroup it did not help.

ps. sorry for my English...

Not sure why the behavior has changed, but I'm guessing that's done on purpose. To circumvent the problem, you could add an .onSelChange function, with:
${If} ${SectionIsSelected} ${SEC_test1}
${AndIf} ${SectionIsSelected} ${SEC_test2}
!insertmacro UnselectSection ${SEC_hidden_test1}
${Else}
!insertmacro SelectSection ${SEC_hidden_test1}
${EndIf}

(Or you can move the hidden section out of the section group entirely.)