Archive: leave function in MUI


leave function in MUI
could not find this in the MUI docs (it should include some examples), how is the syntax for adding a leave function for the components page?


!define MUI_PAGE_CUSTOMFUNCTION_LEAVE "compLeaveFunc"
!insertmacro MUI_PAGE_COMPONENTS

-Stu


!define MUI_PAGE_CUSTOMFUNCTION_LEAVE "YourLeaveFunction"
!insertmacro MUI_PAGE_COMPONENTS

[EDIT]
*hehe*, just a few seconds later than Afrow, damn. :D


alright, i used the above function. my installer displays a warning when the user enables a sectiongroup including sections that delete files.

 Function compLeaveFunc
SectionGetFlags "${SecDelete}" $0
#MessageBox MB_OK "$0"
StrCmp $0 "2" End ; 2=none (?)
MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONEXCLAMATION "You have \
selected to delete some files, which can not be \
restored. Do you want to proceed?" IDYES End
Abort
End:
FunctionEnd

this only works partly. when i select one of the section and want to proceed, the warning pops up. selecting 'No' i get back to the components page. when i don't select any of the sections the warning keeps popping up. this only happens when i previously got a warning and not when i never selected on the sections.

Use the Sections.nsh macros to check wheather a section is selected.


not sure what i'm doing wrong. what the BIT supposed to be in my example?

 Function compLeaveFunc
!insertmacro SectionFlagIsSet ${SecDelete} "2" Warning End

Warning:
MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONEXCLAMATION "You have \
selected to delete some files, which can not be \
restored. Do you want to proceed?" IDYES End
Abort

End:
FunctionEnd

the warning should popup when at least one subsection has been selected

"2" should probably be ${SF_SELECTED}

-Stu


it works with SF_SELECTED when using it for every single section. i tried a combination of SF_SELECTED and SF_PSELECTED, but then the messagebox also showed up when nothing was selected. but this solution is good enough, thanks for the help!