!include "Sections.nsh" Name "PostComp" ; The file to write OutFile "PostComp" ; The default installation directory InstallDir $PROGRAMFILES\PostComp ;-------------------------------- Var Drive1 Var Drive2 Var Drive3 ; Pages Page components "" "" PostComp Page instfiles Section FCMAIN "FCMAIN" MessageBox MB_OK "FCMAIN" SectionEnd Section HOME "HOME" MessageBox MB_OK "HOME" SectionEnd Section DATA "DATA" MessageBox MB_OK "DATA" SectionEnd Section FLIGHTWEATHER "FLIGHTWEATHER" MessageBox MB_OK "FLIGHTWEATHER" SectionEnd Section -FLIGHTWEATHERDATA "-FLIGHTWEATHERDATA" MessageBox MB_OK "-FLIGHTWEATHERDATA" SectionEnd Section FLIGHTVPF "FLIGHTVPF" MessageBox MB_OK "FLIGHTVPF" SectionEnd Section -FLIGHTVPFDATA "-FLIGHTVPFDATA" MessageBox MB_OK "-FLIGHTVPFDATA" SectionEnd Section Help "Help" MessageBox MB_OK "Help" SectionEnd Function PostComp StrCpy $Drive1 0 ; HomeDir space StrCpy $Drive2 0 ; AuxDir space StrCpy $Drive3 0 ; DataDir space MessageBox MB_OK "Clearing Two Flags" !insertmacro ClearSectionFlag ${-FLIGHTWEATHERDATA} ${SF_SELECTED} ; Disable these hidden sections !insertmacro ClearSectionFlag ${-FLIGHTVPFDATA} ${SF_SELECTED} MessageBox MB_OK "Checking Home" !insertmacro SectionFlagIsSet ${HOME} ${SF_SELECTED} +1 NoHome ; Skip ahead if the section is not selected SectionGetSize ${HOME} $R0 IntOp $Drive1 $Drive1 + 1 NoHome: MessageBox MB_OK "Checking Data" !insertmacro SectionFlagIsSet ${DATA} ${SF_SELECTED} +1 NoData SectionGetSize ${DATA} $R0 IntOp $Drive2 $Drive2 + 2 NoData: MessageBox MB_OK "Checking Weather" !insertmacro SectionFlagIsSet ${FLIGHTWEATHER} ${SF_SELECTED} +1 NoWeather SectionGetSize ${FLIGHTWEATHER} $R0 IntOp $Drive1 $Drive1 + 4 !insertmacro SetSectionFlag ${-FLIGHTWEATHERDATA} 1 SectionGetSize ${-FLIGHTWEATHERDATA} $R0 IntOp $Drive2 $Drive2 + 8 NoWeather: MessageBox MB_OK "Checking VPF" !insertmacro SectionFlagIsSet ${FLIGHTVPF} ${SF_SELECTED} +1 NoVPF SectionGetSize ${FLIGHTVPF} $R0 IntOp $Drive1 $Drive1 + 16 !insertmacro SetSectionFlag ${-FLIGHTVPFDATA} 1 SectionGetSize ${-FLIGHTVPFDATA} $R0 IntOp $Drive3 $Drive3 + 32 NoVPF: MessageBox MB_OK "Checking Help" !insertmacro SectionFlagIsSet ${HELP} ${SF_SELECTED} +1 NoHelp SectionGetSize ${HELP} $R0 IntOp $Drive1 $Drive1 + 64 NoHelp: SectionSetSize ${DATA} 0 SectionSetSize ${HOME} 0 SectionSetSize ${FLIGHTWEATHER} 0 SectionSetSize ${-FLIGHTWEATHERDATA} 0 SectionSetSize ${FLIGHTVPF} 0 SectionSetSize ${-FLIGHTVPFDATA} 0 SectionSetSize ${HELP} 0 MessageBox MB_OK "Drive1: $Drive1" MessageBox MB_OK "Drive2: $Drive2" MessageBox MB_OK "Drive3: $Drive3" FunctionEnd