Archive: Installing folder contents


Installing folder contents
Hello world,

what is the "official" (recommended) way to have my NSIS script install all contents of a certain source folder with all included files and subfolders (without the source folder itself), while allowing the case that the source folder is empty?

I typically use something like

SetOutPath $INSTDIR\DestinationFolder
File /r "SourceFolder\*"
but this yields a compile error if "SourceFolder" is empty.

You can use the /nonfatal option to avoid the compile error. I am not quite sure what you mean by the first part, but I always use *.* for the file spec in this type of situation.

File /r /nonfatal "SourceFolder\*.*"