tags:

views:

46

answers:

1

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?

A: 

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  ..\*
Cuga