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?
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
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
"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!