NSIS - 如何在排除文件时递归复制?
我需要递归复制一个目录,但排除其中的几个目录。
NSIS 的文档说 File
命令采用 /r
和 /x
参数,但我无法让它们正常协同工作。
包含 .nsi 脚本的目录结构是:
parent-dir
dir-to-exclude-1
setup.nsi
dir-to-copy-1
dir-to-copy-2
dir-to-copy-3
dir-to-exclude-2
我已经尝试了以下操作,但它对我不起作用:
SetOutPath $INSTDIR
File /r "..\**" /x "..\dir-to-exclude-1\**" /x "..\dir-to-exclude-2\**"
提前感谢您的帮助。
编辑: 我越来越接近了,所以现在我有了:
File /r /x \dir-to-exclude-1\*.* /x \dir-to-exclude-2\*.* ..\*
现在它将编译并安装所有文件,但不排除我想要的目录。有关如何排除这些的任何指导吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在同事的帮助下解决了这个问题。只需给出不带任何 * 的目录名称:
Figured it out with the help of a coworker. Just give the directory names without any *'s: