Hello there.
I'm looking for a way to throw an MB_OK when the user checks all the options.
My installer has many options and some are just for special cases. Yet certain people tend to simply mark every checkbox, (because more is better). I want to put out a hint in that case.
If all options checked...
5 posts
Which page are you talking about? The components page or a custom page?
For the components page you can use the helper macros in sections.nsh in a loop in the page leave callback function or in .onselchange...
For the components page you can use the helper macros in sections.nsh in a loop in the page leave callback function or in .onselchange...
Sorry for being unclear. I mean the components page.
I'm looking at sections.nsh but I don't see a way to check if the user has set all options he can set (not counting: hidden sections and mandatory unset sections).
However I may have found a different solution for my problem: My installer has 2 modes and for my usecase it would probably be enough if I grey out the special options in one of the modes. That I need no help with.
I'm looking at sections.nsh but I don't see a way to check if the user has set all options he can set (not counting: hidden sections and mandatory unset sections).
However I may have found a different solution for my problem: My installer has 2 modes and for my usecase it would probably be enough if I grey out the special options in one of the modes. That I need no help with.
There is no ready to use macro to help you, you have to put the pieces together on your own:
Page Components "" "" OnCompLeave
Page Directory
Page InstFiles
!include LogicLib.nsh
Function OnCompLeave
StrCpy $0 0 ; Section index
StrCpy $1 0 ; Visible unselected count
loop:
ClearErrors
SectionGetText $0 $2
IfErrors stop ; No more sections to check
StrCmp $2 "" next ; Sections with no text are hidden from the user
${IfNotThen} ${SectionIsSelected} $0 ${|} IntOp $1 $1 + 1 ${|}
next:
IntOp $0 $0 + 1
Goto loop
stop:
${If} $1 = 0
MessageBox MB_OK "You selected all the things!"
Abort ; Stop the user from going to the next page
${EndIf}
FunctionEnd
Section /o -hidden
SectionEnd
Section "Foo"
SectionEnd
Section /o "Bar"
SectionEnd Haha, thanks that's great.Originally Posted by Anders View Post"You selected all the things!"