I have a large number of NSIS install scripts (.nsi files) that simply define a bunch of constants and then the main installer logic resides an include file (.nsh) which is common to each of the installers. One of the include files looks like this:
!ifdef ABC_SUBFOLDER
RMDir /r "$ABCPath\Data\${ABC_SUBFOLDER}"
SetOutPath "$ABCPath\Data\${ABC_SUBFOLDER}"
File /r "${LOCAL_FOLDER}\ABC\${ABC_SUBFOLDER}\*.*"
!endif
!ifdef ABC_SUBFOLDER2
RMDir /r "$ABCPath\Data\${ABC_SUBFOLDER2}"
SetOutPath "$ABCPath\Data\${ABC_SUBFOLDER2}"
File /r "${LOCAL_FOLDER2}\ABC\${ABC_SUBFOLDER2}\*.*"
!endif
!ifdef ABC_SUBFOLDER3
RMDir /r "$ABCPath\Data\${ABC_SUBFOLDER3}"
SetOutPath "$ABCPath\Data\${ABC_SUBFOLDER3}"
File /r "${LOCAL_FOLDER3}\ABC\${ABC_SUBFOLDER3}\*.*"
!endif
... and so on up to 15 subfolders that may or may not be defined in the top level .nsi file. My question is, is there any better syntax in NSIS to achieve this without cut and pasting every time I need to increase the number of subfolders to support?