What's wrong with this INF file?

I hate INF files.

Following is an inf file for a commercial product. Not mine, but I have to
use the thing as part of my product. When I plug in the USB device that
this INF is for, the usual installer stuff happens, but it fails to copy the
sys file to system32\drivers on W2K or XP. Of course the device then
doesn’t work.

I called the vendor, and their response is “don’t use the installer, use our
bat file that just manually copies the driver and inf files into the right
places on drive C:, THEN plug in the device.” In the immortal words of
Bill Cosby, Riiiiight…

I’m sure I could debug this sucker myself if I want to devote a day or so to
it; but I’m hoping someone here likes INF files more than I do and can just
look at it and tell me which line, parameter, or section is missing or
wrong. Thanks in advance! (Oh, I need this to work on both Win98&Friends
and real operating systems. Haven’t tried it on the toys yet to see if it
works there.)

Loren

The error from setupapi.log is:

#-166 Device install function: DIF_INSTALLDEVICEFILES.
#-011 Installing section [USBDongle] from “p:\dongle\usbkey2k.inf”.
#E395 Unable to determine source information for disk ID 1.
#E065 Parsing Copyfiles section [USBDongleCopy.NT] in
“p:\dongle\usbkey2k.inf” failed. Error 0xe0000102: The required line was not
found in the INF.

The INF file is:

[Version]
Signature=“$WINDOWS NT$”
Class=USBDongle
ClassGUID={7C485487-0AF4-11d4-BA51-004005A6C1C4}
Provider=“Insert your company name here.”

[SourceDisksFiles]
USBKey.sys=1

[ClassInstall32.NT]
Addreg=HwClass.NT

[HwClass.NT]
HKR,%ClassName%
HKR,Icon,“-5”

[DestinationDirs]
DefaultDestDir=12
USBDongleCopy.NT=10,system32\drivers

[Manufacturer]
%Mfg%=MfgDeviceSection

[MfgDeviceSection]
%DeviceDesc% = USBDongle, USB\VID_07F2&PID_0001

[USBDongle]
CopyFiles=USBDongleCopy.NT

[USBDongleCopy.NT]
USBKey.sys

[USBDongle.Services]
AddService = USBDongle,%SPSVCINST_ASSOCSERVICE%,USBDongleInst

[USBDongleInst]
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_MANUAL_START%
ErrorControl = %SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\USBKey.sys

[Strings]
ClassName =“USB Dongles”
DeviceDesc = “USB Dongle - Software Protection Device”
DiskId = “Install disk”
Mfg = “Put your company name here.”
SPSVCINST_ASSOCSERVICE = 0x00000002
SERVICE_KERNEL_DRIVER = 1
SERVICE_MANUAL_START = 3
SERVICE_ERROR_NORMAL = 1

Loren Wilton wrote:

Following is an inf file for a commercial product. Not mine, but I have to
use the thing as part of my product. When I plug in the USB device that
this INF is for, the usual installer stuff happens, but it fails to copy the
sys file to system32\drivers on W2K or XP. Of course the device then
doesn’t work.

I don’t see a SourceDisksNames section in there, which may be the
problem. This INF also lacks all the 98/Me sections that you say you
need.

There are several model INF files for USB devices in ch. 12 of my book,
and there is a simple introduction to INF writing in ch. 15. You might
also check out Brian Catlin’s tutorial at
http://www.wd-3.com/archive/InfFiles.htm.


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com

Well I allways say run ChkInf and fix all errors and warnings, in your
case one gets:

Errors:
Line 0: (E22.1.1003) Section [SourceDisksNames] not defined.
Line 1: (E22.1.1080) Directive: DriverVer required (and must not be blank)
in section [Version]
Line 1: (E22.1.1081) Directive: CatalogFile required (and must not be blank)
in section [Version] for WHQL digital signature.
Line 3: (E22.1.1310) Class USBDongle (ClassGUID
{7C485487-0AF4-11d4-BA51-004005A6C1C4}) is unrecognized.

Warnings:
Line 0: (W22.1.2212) No Copyright information found.

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

----- Original Message -----
From: “Loren Wilton”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, October 22, 2003 2:32 AM
Subject: [ntdev] What’s wrong with this INF file?

> I hate INF files.
>
> Following is an inf file for a commercial product. Not mine, but I have
to
> use the thing as part of my product. When I plug in the USB device that
> this INF is for, the usual installer stuff happens, but it fails to copy
the
> sys file to system32\drivers on W2K or XP. Of course the device then
> doesn’t work.
>
> I called the vendor, and their response is “don’t use the installer, use
our
> bat file that just manually copies the driver and inf files into the right
> places on drive C:, THEN plug in the device.” In the immortal words of
> Bill Cosby, Riiiiight…
>
> I’m sure I could debug this sucker myself if I want to devote a day or so
to
> it; but I’m hoping someone here likes INF files more than I do and can
just
> look at it and tell me which line, parameter, or section is missing or
> wrong. Thanks in advance! (Oh, I need this to work on both Win98&Friends
> and real operating systems. Haven’t tried it on the toys yet to see if it
> works there.)
>
> Loren
>
>
> The error from setupapi.log is:
>
> #-166 Device install function: DIF_INSTALLDEVICEFILES.
> #-011 Installing section [USBDongle] from “p:\dongle\usbkey2k.inf”.
> #E395 Unable to determine source information for disk ID 1.
> #E065 Parsing Copyfiles section [USBDongleCopy.NT] in
> “p:\dongle\usbkey2k.inf” failed. Error 0xe0000102: The required line was
not
> found in the INF.
>
>
> The INF file is:
>
> [Version]
> Signature=“$WINDOWS NT$”
> Class=USBDongle
> ClassGUID={7C485487-0AF4-11d4-BA51-004005A6C1C4}
> Provider=“Insert your company name here.”
>
> [SourceDisksFiles]
> USBKey.sys=1
>
> [ClassInstall32.NT]
> Addreg=HwClass.NT
>
> [HwClass.NT]
> HKR,%ClassName%
> HKR,Icon,“-5”
>
> [DestinationDirs]
> DefaultDestDir=12
> USBDongleCopy.NT=10,system32\drivers
>
> [Manufacturer]
> %Mfg%=MfgDeviceSection
>
> [MfgDeviceSection]
> %DeviceDesc% = USBDongle, USB\VID_07F2&PID_0001
>
> [USBDongle]
> CopyFiles=USBDongleCopy.NT
>
> [USBDongleCopy.NT]
> USBKey.sys
>
> [USBDongle.Services]
> AddService = USBDongle,%SPSVCINST_ASSOCSERVICE%,USBDongleInst
>
> [USBDongleInst]
> ServiceType = %SERVICE_KERNEL_DRIVER%
> StartType = %SERVICE_MANUAL_START%
> ErrorControl = %SERVICE_ERROR_NORMAL%
> ServiceBinary = %12%\USBKey.sys
>
> [Strings]
> ClassName =“USB Dongles”
> DeviceDesc = “USB Dongle - Software Protection Device”
> DiskId = “Install disk”
> Mfg = “Put your company name here.”
> SPSVCINST_ASSOCSERVICE = 0x00000002
> SERVICE_KERNEL_DRIVER = 1
> SERVICE_MANUAL_START = 3
> SERVICE_ERROR_NORMAL = 1
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@acm.org
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

> I don’t see a SourceDisksNames section in there, which may be the

problem. This INF also lacks all the 98/Me sections that you say you
need.

Ah, thanks! I bet that is it, I’ll try it in a bit (as soon as I finish
debugging some microcode in an mp3 player).

I forgot that they have a second INF file for Win98. I’ll look at the two
of them and see about merging them into a single usable file.

Thanks,

Loren