Archive: Need help with Components page leave function


Need help with Components page leave function
Is there any example how use Modern UI leave function on Components page ?


What do you want the function to do. I might be able to help you out.

Vytautas


Have components page without mandatory section selected.
I don't alow user leave components page if anything is select.


!define MUI_PAGE_CUSTOMFUNCTION_LEAVE <LeaveFunctionName>
!insertmacro MUI_PAGE_COMPONENTS

[...]

Function <LeaveFunctionName>
[...]
FunctionEnd


but why do u have a componentspage, if nothing sould be selected????
or do u mean, that just not _everything_ should be selected?

Use the SectionFlagIsSet macro in Include\Sections.nsh (!include "Sections.nsh") along with the SF_SELECTED flag to check if a certain section is selected. For example:

!insertmacro SectionFlagIsSet ${section1} ${SF_SELECTED} selected notselected
selected:
MessageBox MB_OK "section 1 is selected"
Goto done
notselected:
MessageBox MB_OK "section 1 is NOT selected"
done:

In my components page, some sections are disabled depends on detection if other programs installed on this computer. User may install all components which are enabled or only one enabled component. I don't allow user leave components page if nothing is selected.

comm@nder21 code works fine for me. Thanks a lot.