| NSIS Home > NSIS Archive > NSIS Programmer's Reference |
|
Adds file(s) to be extracted to the . SyntaxFile [/nonfatal] [/a] ((/r path) | filepattern) [...]) | (/oname=destname srcfile) The File statement syntax has these parts:
NoteThe output filename is \filename, where filename is the filename portion of the files specified by path or filepattern. RemarksIf path is used with trailing wildcards (e.g. C:\mydir\*.*) and the /r switch is used, then the whole tree of path will go in \. If no trailing wildcards are used, the whole tree of path will go in \lastdir, where lastdir is the last directoryname path contains (e.g. \mydir). The File statement sets the error flag if SetOverwrite try is used and the file could not be overwritten, or if SetOverwrite on is used, the file could not be overwritten and the user clicked the Ignore-button. ExamplesThis example shows how to include the NSIS directory and it's subdirectories and contents into the package and extract it later to :
File /r "${NSISDIR}\*.*"
The following example includes multiple files into the package:
File "${NSISDIR}\Contrib\*.bmp" "${NSISDIR}\makensis.htm" "${NSISDIR}\Examples\*.*"
And this example includes makensis.htm, but extracts it as readme.html.
File /oname="readme.html" "${NSISDIR}\makensis.htm"
See also |