Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSIS - How to copy recursively while excluding files?

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?

like image 986
Cuga Avatar asked Jul 14 '10 19:07

Cuga


1 Answers

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  ..\*
like image 101
Cuga Avatar answered Sep 28 '22 07:09

Cuga