Old 14th January 2010, 05:32   #1
sanyaka
Junior Member
 
Join Date: Jan 2010
Location: Russia
Posts: 1
Hidden section and Subsection

Hello.

If i use this code on NSIS 2.01:
code:

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...
sanyaka is offline   Reply With Quote
Old 14th January 2010, 07:55   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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.)
MSG 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