!include Sections.nsh !define SECTION_ON ${SF_SELECTED} SectionGroup "Config Files" Section "Default Notesfile" secNotes CreateDirectory "notes" SetOutPath "$INSTDIR\notes" File "current.txt" SetOutPath "$INSTDIR" SectionEnd Section "Default Search.xml" secSearch File "search.xml" SectionEnd Section "Default Bookmarks.xml" secBooks File "bookmarks.xml" SectionEnd SectionGroupEnd ;===============================================================; Function .onInit IfFileExists $INSTDIR\notes\*.* NotesExists NoNotes NotesExists: SectionSetFlags ${secNotes} $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secNotes} $0 NoNotes: !insertmacro SelectSection ${secNotes} IfFileExists $INSTDIR\search.xml SearchExists NoSearch SearchExists: SectionSetFlags ${secSearch} $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secSearch} $0 NoSearch: !insertmacro SelectSection ${secSearch} IfFileExists $INSTDIR\bookmarks.xml BookExists NoBook BookExists: SectionSetFlags ${secBooks} $0 IntOp $0 $0 & ${SECTION_OFF} SectionSetFlags ${secBooks} $0 NoBook: !insertmacro SelectSection ${secBooks} FunctionEnd