I need to copy a directory recursively but exclude a couple of directories within it.
The documentation for NSIS says the File
command takes /r
and /x
parameters, but I cannot get them to work together properly.
The structure of my directory containing my .nsi script is:
parent-dir
dir-to-exclude-1
setup.nsi
dir-to-copy-1
dir-to-copy-2
dir-to-copy-3
dir-to-exclude-2
And I've tried the following, but it's not working for me:
SetOutPath $INSTDIR
File /r "..\**" /x "..\dir-to-exclude-1\**" /x "..\dir-to-exclude-2\**"
Thanks in advance for any help.
Edit: I'm getting closer, so now I have:
File /r /x \dir-to-exclude-1\*.* /x \dir-to-exclude-2\*.* ..\*
Now it will compile and install all the files, but without excluding the directories I want. Any guidance for how I can exclude these?
Figured it out with the help of a coworker. Just give the directory names without any *'s:
File /r /x dir-to-exclude-1 /x dir-to-exclude-2 /x installer ..\*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With