everyone. I am trying to include some \"parentdir\" with files to my installer. The thing is: I use /r parameter to include all files and folders, like this:
Fil
You can create a batch file (or any other program) that searches the disk and writes File
instructions to a .nsh file. Your .nsi would first use !system
to execute the external application that generates the .nsh and then !include
it:
Section
SetOutPath "$INSTDIR\parentdir"
!tempfile filelist
!system '"generatefilelist.bat" ".\parentdir" "${filelist}"'
!include "${filelist}"
!delfile "${filelist}"
SectionEnd
...and the batch-file might look something like this:
@echo off
FOR /R "%~1" %%A IN (*.txt) DO (
>> "%~2" echo.File "%%~A"
)
If the pattern is simple enough you don't need a separate batch-file, you can just use cmd.exe directly:
Section
SetOutPath "$INSTDIR\parentdir"
!tempfile filelist
!system 'FOR /R ".\parentdir" %A IN (*.txt) DO @( >> "${filelist}" echo.File "%~A" )'
!include "${filelist}"
!delfile "${filelist}"
SectionEnd