The Copy Files section lists the files to copy from a source disk to a destination directory. The source disk and destination directory associated with each file are specified in other sections of the INF file. The file-list-section name must appear in the CopyFiles item of an Install section.
You can copy a single file with the CopyFiles item of an Install section, without building a Copy Files section.
[file-list-section]
destination-file-name[,source-file-name][,temporary-file-name][,flag]
[destination-file-name[,source-file-name][,temporary-file-name]][,flag]
.
.
.
destination-file-name
Name of the destination file. If no source filename is given, this is also the name of the source file.
source-file-name
Name of the source file. If the source and destination filenames for the file copy operation are the same, source-file-name is not required.
temporary-file-name
Name of a temporary file for the file copy operation. The installer copies the source file, but gives it a temporary filename. The next time the operating system starts, it renames the temporary file to the destination filename. Temporary files can be used to copy files to a destination which is currently open or in use. This parameter is not currently implemented. The Setup functions automatically generate temporary filenames when necessary.
flag
Optional. These flags can be used to control how files are copied. Values are specified in base 10 or, if prefixed with 0x, in base 16.
COPYFLG_WARN_IF_SKIP (0x00000001)
Send a warning if the user elects to not copy a file.
COPYFLG_NOSKIP (0x00000002)
Do not allow the user to skip copying a file.
COPYFLG_NOVERSIONCHECK (0x00000004)
Ignore file versions and write over existing files in the destination directory.
COPYFLG_FORCE_FILE_IN_USE (0x00000008)
Force file-in-use behavior.
COPYFLG_NO_OVERWRITE (0x00000010)
Do not write over an existing file in the destination directory with a source file.
COPYFLG_NO_VERSION_DIALOG (0x00000020)
Do not write over a file in the destination directory with the source file if the existing file is newer than the source file.
COPYFLG_REPLACEONLY (0x00000040)
Copy the source file to the destination directory only if the file is already present in the destination directory.
This example copies two files:
[CopyTheseFilesSec]
file11 ; copies file11
file31, file32 ; copies file32 to file31
All the source filenames used in this example must be defined in a SourceDisksFiles section and the Directory identifiers that appear in the SourceDisksFiles section must be defined in a SourceDisksNames section. As an alternative, you can use a layout.inf file to supply this information.