[INF Tip] CopyFiles and a single file

Discuss & post Update Pack addons here.
Post Reply
User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

[INF Tip] CopyFiles and a single file

Post by ricktendo64 » Thu Sep 20, 2007 3:52 am

Hey guys don't know if this has been disscussed before but:

If you are using CopyFiles in your INF to copy a single file you probably use something like this.

Code: Select all

CopyFiles=Section.Name

[DestinationDirs]
Section.Name=ldid(,subdir)

[Section.Name]
singlefile.ext ;<-This is a section only has single file, we don't need it
Here is another way (I will be using a example that copies my INF to the %WinDir%\inf directory for uninstall.)

Code: Select all

[DefaultInstall]
CopyFiles=@USDownld.inf

[DestinationDirs]
DefaultDestDir=17 ;<-This sets the default destination dir of the file/s with the "@" symbol
Its really quite simple, in CopyFiles you add the "@" symbol followed by the filename and extention.

Code: Select all

CopyFiles=@filename.ext
In [DestinationDirs] you add a DefaultDestDir

Code: Select all

[DestinationDirs]
DefaultDestDir=ldid(,subdir)
Note that you can specify the copying of a single file in the CopyFiles item of the Install section itself, without building a CopyFiles section. To do this, use the special character "@" to force a single file copy. An example of using the "@" character in a CopyFiles-type item is in the Install section reference topic. Copying a single file in this way is somewhat limited because the source and destination filenames must be the same in this case and you cannot use a temporary file.

The following example shows how to copy individual files:
CopyFiles=FileSection1,@myfile.txt,@anotherfile.txt,LastSectionName

[DestinationDirs]
FileSection1=ldid(, subdir)
DefaultDestDir=ldid(, subdir) ;<-This is where the files get copied
LastSectionName=ldid(, subdir)
Source: INF_DOC

Mitsuko Aninikkou
Posts: 210
Joined: Tue Dec 13, 2005 12:52 pm
Location: The Netherlands (But running US WinXP, in case it comes up)

Post by Mitsuko Aninikkou » Thu Sep 20, 2007 9:39 am

Oh yeah, actually knew about that one but I forgot. Thanks for the refresher course :)

User avatar
ricktendo64
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Thu Sep 20, 2007 3:03 pm

Wish it worked with DelFiles I could use it to del the .PNF

Post Reply