;old script ; !define MUI_CUSTOMFUNCTION_COMPONENTS_LEAVE "CheckComponents" ; !insertmacro MUI_PAGE_COMPONENTS ;new script !insertmacro MUI_PAGE_COMPONENTS #CUSTOM PAGE Page custom CheckComponents Function .onInit SectionGetFlags ${secLicense} $1 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secLicense} $1 SectionGetFlags ${secDST} $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secDST} $0 # !insertmacro SelectSection ${secDST} SectionGetFlags ${secEMD} $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secEMD} $0 # !insertmacro UnselectSection ${secEMD} SectionGetFlags ${secHUS} $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secHUS} $0 # !insertmacro UnselectSection ${secHUS} SectionGetFlags ${secJEF} $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secJEF} $0 # !insertmacro UnselectSection ${secJEF} SectionGetFlags ${secPES} $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secPES} $0 # !insertmacro UnselectSection ${secPES} SectionGetFlags ${secXXX} $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secXXX} $0 # !insertmacro UnselectSection ${secXXX} Pop $0 FunctionEnd ;------------------------------------***----------------- Function .onSelChange Push $0 !ifdef USE_SUBSECTION Push $2 StrCpy $2 ${SF_SELECTED} SectionGetFlags ${secLicense} $0 IntOp $2 $2 & $0 SectionGetFlags ${secDST} $0 IntOp $2 $2 & $0 SectionGetFlags ${secEMD} $0 IntOp $2 $2 & $0 SectionGetFlags ${secEXP} $0 IntOp $2 $2 & $0 SectionGetFlags ${secHUS} $0 IntOp $2 $2 & $0 SectionGetFlags ${secJEF } $0 IntOp $2 $2 & $0 SectionGetFlags ${secPES} $0 IntOp $2 $2 & $0 SectionGetFlags ${secXXX} $0 IntOp $2 $2 & $0 StrCmp $2 0 skip SectionSetFlags ${secLicense} 1 SectionSetFlags ${secDST} 0 SectionSetFlags ${secEMD} 0 SectionSetFlags ${secHUS} 0 SectionSetFlags ${secJEF} 0 SectionSetFlags ${secPES} 0 SectionSetFlags ${secXXX} 0 skip: Pop $2 !endif ; Turn off old selected section SectionGetFlags $1 $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags $1 $0 # !insertmacro UnselectSection $1 ; Now remember the current selection Push $2 StrCpy $2 $1 SectionGetFlags ${secDST} $0 IntOp $0 $0 & ${SF_SELECTED} IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${secDST} SectionGetFlags ${secEMD} $0 IntOp $0 $0 & ${SF_SELECTED} IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${secEMD} SectionGetFlags ${secHUS} $0 IntOp $0 $0 & ${SF_SELECTED} IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${secHUS} SectionGetFlags ${secJEF} $0 IntOp $0 $0 & ${SF_SELECTED} IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${secJEF} SectionGetFlags ${secPES} $0 IntOp $0 $0 & ${SF_SELECTED} IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${secPES} SectionGetFlags ${secXXX} $0 IntOp $0 $0 & ${SF_SELECTED} IntCmp $0 ${SF_SELECTED} 0 +2 +2 StrCpy $1 ${secXXX} StrCmp $2 $1 0 +5 ; selection hasn't changed SectionGetFlags $1 $0 IntOp $0 $0 | ${SF_SELECTED} SectionSetFlags $1 $0 # !insertmacro SelectSection $1 Pop $2 Pop $0 FunctionEnd Function CheckComponents SectionGetFlags ${SecDST} $R0 StrCmp $R0 1 done SectionGetFlags ${SecEMD} $R0 StrCmp $R0 1 done SectionGetFlags ${SecHUS} $R0 StrCmp $R0 1 done SectionGetFlags ${SecJEF} $R0 StrCmp $R0 1 done SectionGetFlags ${SecPES} $R0 StrCmp $R0 1 done SectionGetFlags ${SecXXX} $R0 StrCmp $R0 1 done MessageBox MB_OK|MB_ICONEXCLAMATION "Please select a component to install!" Abort ;goes back to page done: ;if component was selected FunctionEnd