Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy a directory using NSIS .

Tags:

I can't seem to find any information about how to copy a directory using NSIS ?, i know there is a file command but is there any command to copy a directory .

like image 228
rajat Avatar asked Jun 13 '12 11:06

rajat


People also ask

How do I copy a directory in Linux?

To copy files or directories in Unix-based operating systems (Linux and MacOS), you use the cp command. The cp command is a relatively simple command, but its behavior changes slightly depending on the inputs (files vs directories) and the options you pass to it.

How do I copy a folder to another directory in bash?

Copy a Directory and Its Contents ( cp -r ) Similarly, you can copy an entire directory to another directory using cp -r followed by the directory name that you want to copy and the name of the directory to where you want to copy the directory (e.g. cp -r directory-name-1 directory-name-2 ).

How do I copy and paste a directory in Linux terminal?

You can copy files by right-clicking on the file and selecting "Copy", then going to a different directory and selecting "Paste". For my terminal friends, you can also perform file copy-paste operations without leaving the terminal. In a Linux-based terminal, you do this using the cp command.

How do I copy a directory and its contents in Linux?

Copying Directories with cp Command To copy a directory, including all its files and subdirectories, use the -R or -r option. The command above creates the destination directory and recursively copy all files and subdirectories from the source to the destination directory.


1 Answers

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.

like image 93
nawfal Avatar answered Sep 19 '22 07:09

nawfal