Copy Files

A 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. For more information, see Install 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
This value is ignored. The setup functions automatically generate names for temporary files.
flag
Optional. These flags can be used to control how files are copied. You must specify the actual numerical value in the INF file.
COPYFLG_WARN_IF_SKIP (0x00000001)
Display a warning if the user tries to skip a file after an error has occurred.
COPYFLG_NOSKIP (0x00000002)
Do not allow the user to skip copying the 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. Handle the file as if it was in use during the file copying operation.
COPYFLG_NO_OVERWRITE (0x00000010)
Do not overwrite an existing file in the destination directory.
COPYFLG_NO_VERSION_DIALOG (0x00000020)
Do not overwrite a file in the destination directory 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.

The following 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 specified in the Version section to supply this information. A layout INF file is a file that contains a SourceDisksFiles section and a SourceDisksNames section.

See Also

Overview, INF File Format Reference