简体   繁体   中英

Copy a directory using NSIS .

我似乎无法找到有关如何使用NSIS复制目录的任何信息?我知道有一个文件命令但是有任何复制目录的命令。

The syntax is same for both directory and file, except that you need to specify a directory by providing a \\ at the end. File command copies the directory if the specified argument is a directory. For eg, you can do:

SetOutPath "outputPath"
File "myDirectory\" #note back slash at the end

But that copies only the top level directory. To recursively do it, you have /r switch

SetOutPath "outputPath"
File /nonfatal /a /r "myDirectory\" #note back slash at the end

which copies the contents of myDirectory (but not myDirectory folder itself). /nonfatal ignores without an error if there is no particular directory. /a copies file attributes as well. /x switch is used to exclude files.

Otherwise,

SetOutPath "outputPath\myDirectory"
File /nonfatal /a /r "myDirectory\" #note back slash at the end

copies all the contents of myDirectory including myDirectory folder to outputPath .

I found how to do it , sorry for the trouble .

Extract the files to a directory which can't exist beforehand

CreateDirectory $Installdir\extracting

SetOutPath $Installdir\extracting

File Directory\*

File指令从安装程序中提取文件, CopyFiles复制最终用户系统上已存在的文件和/或目录(如果需要从安装程序所在的DVD复制文件,则可以使用$ EXEDIR ...)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM