<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Reference%2FFile</id>
	<title>Reference/File - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Reference%2FFile"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Reference/File&amp;action=history"/>
	<updated>2026-06-07T13:30:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Reference/File&amp;diff=21283&amp;oldid=prev</id>
		<title>Jan: /* File */</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Reference/File&amp;diff=21283&amp;oldid=prev"/>
		<updated>2011-11-25T16:45:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;File&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;â† Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:45, 25 November 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Note that the output file name is $OUTDIR\filename_portion_of_file.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Note that the output file name is $OUTDIR\filename_portion_of_file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Use /oname=X switch to change the output name. X may contain variables and can be a fully qualified path or a relative path in which case it will be appended to $OUTDIR set by [[Reference/SetOutPath|SetOutPath]]. When using this switch, only one file can be specified. If the output name contains spaces, quote the entire parameter, including /oname, as shown in the examples below.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Use /oname=X switch to change the output name. X may contain variables and can be a fully qualified path or a relative path in which case it will be appended to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Reference/&lt;/ins&gt;$OUTDIR&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|$OUTDIR]] &lt;/ins&gt;set by [[Reference/SetOutPath|SetOutPath]]. When using this switch, only one file can be specified. If the output name contains spaces, quote the entire parameter, including /oname, as shown in the examples below.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Wildcards are supported.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Wildcards are supported.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*If the /r switch is used, matching files and directories are recursively searched for in subdirectories. If just one path segment is specified (e.g. File /r something), the current directory will be recursively searched. If more than one segment is specified (e.g. File /r something\*.*), the last path segment will be used as the matching condition and the rest for the directory to search recursively. If a directory name matches, all of its contents is added recursively. Directory structure is preserved.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*If the /r switch is used, matching files and directories are recursively searched for in subdirectories. If just one path segment is specified (e.g. File /r something), the current directory will be recursively searched. If more than one segment is specified (e.g. File /r something\*.*), the last path segment will be used as the matching condition and the rest for the directory to search recursively. If a directory name matches, all of its contents is added recursively. Directory structure is preserved.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key n22049_wiki-wiki_:diff::1.12:old-21282:rev-21283 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jan</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Reference/File&amp;diff=21282&amp;oldid=prev</id>
		<title>Jan: Created page with &quot;=File=   [/nonfatal] [/a] ([/r] [/x file|wildcard [...]] (file|wildcard) [...] | /oname=file.dat infile.dat)  Adds file(s) to be extracted to the current output path ($OUTDIR).  ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Reference/File&amp;diff=21282&amp;oldid=prev"/>
		<updated>2011-11-25T16:44:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=File=   [/nonfatal] [/a] ([/r] [/x file|wildcard [...]] (file|wildcard) [...] | /oname=file.dat infile.dat)  Adds file(s) to be extracted to the current output path ($OUTDIR).  ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=File=&lt;br /&gt;
&lt;br /&gt;
 [/nonfatal] [/a] ([/r] [/x file|wildcard [...]] (file|wildcard) [...] | /oname=file.dat infile.dat)&lt;br /&gt;
&lt;br /&gt;
Adds file(s) to be extracted to the current output path ($OUTDIR).&lt;br /&gt;
&lt;br /&gt;
*Note that the output file name is $OUTDIR\filename_portion_of_file.&lt;br /&gt;
*Use /oname=X switch to change the output name. X may contain variables and can be a fully qualified path or a relative path in which case it will be appended to $OUTDIR set by [[Reference/SetOutPath|SetOutPath]]. When using this switch, only one file can be specified. If the output name contains spaces, quote the entire parameter, including /oname, as shown in the examples below.&lt;br /&gt;
*Wildcards are supported.&lt;br /&gt;
*If the /r switch is used, matching files and directories are recursively searched for in subdirectories. If just one path segment is specified (e.g. File /r something), the current directory will be recursively searched. If more than one segment is specified (e.g. File /r something\*.*), the last path segment will be used as the matching condition and the rest for the directory to search recursively. If a directory name matches, all of its contents is added recursively. Directory structure is preserved.&lt;br /&gt;
*Use the /x switch to exclude files or directories.&lt;br /&gt;
*If the /a switch is used, the attributes of the file(s) added will be preserved.&lt;br /&gt;
*The File command sets the error flag if overwrite mode is set to &amp;#039;try&amp;#039; and the file could not be overwritten, or if the overwrite mode is set to &amp;#039;on&amp;#039; and the file could not be overwritten and the user selects ignore.&lt;br /&gt;
*If the /nonfatal switch is used and no files are found, a warning will be issued instead of an error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;File something.exe&lt;br /&gt;
File /a something.exe&lt;br /&gt;
File *.exe&lt;br /&gt;
File /r *.dat&lt;br /&gt;
File /r data&lt;br /&gt;
File /oname=temp.dat somefile.ext&lt;br /&gt;
File /oname=$TEMP\temp.dat somefile.ext&lt;br /&gt;
File &amp;quot;/oname=$TEMP\name with spaces.dat&amp;quot; somefile.ext&lt;br /&gt;
File /nonfatal &amp;quot;a file that might not exist&amp;quot;&lt;br /&gt;
File /r /x CVS myproject\*.*&lt;br /&gt;
File /r /x *.res /x *.obj /x *.pch source\*.*&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: when using the &amp;#039;&amp;#039;/r&amp;#039;&amp;#039; switch, both matching directories and files will be searched. This is always done with or without the use of wildcards, even if the given path perfectly matches one directory. That means, the following directory structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&amp;lt;DIR&amp;gt; something&lt;br /&gt;
  file.dat&lt;br /&gt;
  another.dat&lt;br /&gt;
&amp;lt;DIR&amp;gt; dir&lt;br /&gt;
  something&lt;br /&gt;
  &amp;lt;DIR&amp;gt; dir2&lt;br /&gt;
    file2.dat&lt;br /&gt;
&amp;lt;DIR&amp;gt; another&lt;br /&gt;
  &amp;lt;DIR&amp;gt; something&lt;br /&gt;
    readme.txt&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the following File usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;File /r something&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will match the directory named &amp;#039;&amp;#039;something&amp;#039;&amp;#039; on the root directory, the file named &amp;#039;&amp;#039;something&amp;#039;&amp;#039; in the directory named dir and the directory named something in the directory named &amp;#039;&amp;#039;another&amp;#039;&amp;#039;. To match only the directory named something on the root directory, use the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;File /r something\*.*&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When adding \*.*, it will be used as the matching condition and &amp;#039;&amp;#039;something&amp;#039;&amp;#039; will be used as the directory to search. When only &amp;#039;&amp;#039;something&amp;#039;&amp;#039; is specified, the current directory will be recursively searched for every and directory named &amp;#039;&amp;#039;something&amp;#039;&amp;#039; and &amp;#039;&amp;#039;another\something&amp;#039;&amp;#039; will be matched.&lt;/div&gt;</summary>
		<author><name>Jan</name></author>
	</entry>
</feed>