mday299
mday299

Reputation: 139

NSIS recursive file copy using CopyFiles rather than File command

For an NSIS installer I have been using this command:

SetOutPath $INSTDIR\data
File /r /x *.svn data\newTerrainTiled

to copy my data files into the executable itself. I now have a larger data set that has outgrown the maximum size of the installer executable. I tried to change my code to this:

SetOutPath $INSTDIR\data
CopyFiles /r $EXEDIR\data\newTerrainTiled

But obviously CopyFiles does not have a recursive flag. I realize I could create the subdirectories of the newTerrainTiled folder one by one and then used CopyFiles with the wildcard (*) character. I wanted to know if someone has already come up with a recursive method of copying using CopyFiles in place of File for when data sets become large.

Thanks.

Upvotes: 1

Views: 9825

Answers (1)

Anders
Anders

Reputation: 101569

  • The File instruction packs files from the system you are compiling on into the installer.
  • CopyFiles copies files and/or folders from a to b on the end users system! (That is, both the source and destination is on the end users system and the source files actually have to exist before you copy)

CopyFiles can copy a directory (with all files and subfolders) but in your case it would only be useful if the data directory was on a CD/DVD along with the installer.

Other alternatives are:

  • Put the data files in a external archive (zip etc) and use one of the NSIS plugins to extract.
  • Append the data to the end of the generated installer and extract that ("unlimited" file size)

Upvotes: 9

Related Questions