DPInst Installer Question

My customer wants a standalone version of the driver installer, so I am creating an XML file. I am getting DPInst to report a successful install, and the INF files get copied to the Windows/INF directory as well as the registry settings get in there, but the driver files themselves are not always copied.

There are two drivers to install and on the computer I’m testing on right now, only one of the devices are installed. (These are legacy drivers with no PnP capability on the hardware.)

When I tested the install on a computer with both hardware devices installed, the drivers get copied.

It appears that if both hardware devices are not there, neither driver is copied. This will be a problem in a live environment, there is no guarantee both hardware devices will be there.

How do I force both driver files to be copied whether it is there or not?

I’m using the following switches in the xml file:

I don’t see any switches that would work any better.

Bill

Can you post your INF?

Are both of your ‘drivers’ installed from a single INF? If so, try
splitting into one INF per ‘device’.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@toc-cs.com
Sent: Tuesday, November 23, 2010 4:17 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] DPInst Installer Question

My customer wants a standalone version of the driver installer, so I am
creating an XML file. I am getting DPInst to report a successful install,
and the INF files get copied to the Windows/INF directory as well as the
registry settings get in there, but the driver files themselves are not
always copied.

There are two drivers to install and on the computer I’m testing on right
now, only one of the devices are installed. (These are legacy drivers with
no PnP capability on the hardware.)

When I tested the install on a computer with both hardware devices
installed, the drivers get copied.

It appears that if both hardware devices are not there, neither driver is
copied. This will be a problem in a live environment, there is no guarantee
both hardware devices will be there.

How do I force both driver files to be copied whether it is there or not?

I’m using the following switches in the xml file:

I don’t see any switches that would work any better.

Bill


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

What about chkinf test?

It appears it can find some problems which may be reflected into some weird difxapp/dpinst problems.

I have two separate INFs, one for each driver. I don’t understand why one wouldn’t install if the other did. DPInst is reporting success installing both drivers, but the driver files aren’t there if the ISA card is not installed.

One driver is a parallel port driver for EPP mode called inpout32. The other is for a fairly simple ISA card with three I/O registers and nothing else, it is called MTIsaDrv.

I fixed all the problems chkinf found. Before trying DPInst, I did get them to install correctly with the Add Hardware Wizard. Using that method I didn’t try installing the ISA card on a machine without the hardware though.

Another issue I found after I wrote my initial post was that when the drivers are installed with DPInst, they don’t show up in Device Manager. They work with the hardware the same as they did when installed with the Add Hardware Wizard, they just don’t show. When installed with the Add Hardware Wizard, they show up in Device Manager. I did find that entries are in Add/Remove Programs for each of the drivers after installing with DPInst.

Is there some way to get these to show up in Device Manager too?

Another thing that is more just an annoyance than anything else, when the ISA driver was showing up in Device Manager, DM was claiming there was no resources allocated, though it said it was installed correctly and working correctly. If you clicked the button provided on the resource tab and allocated resources, it wanted to reboot afterwards. When the system came back up, it was unchanged.

This last issue may be a quirk with the ISA sub-system under XP. I doubt Microsoft gave much thought to ISA when developing their more recent OSs since ISA has been mostly dead for years. The only way you can get an ISA motherboard these days is to buy an “industrial” motherboard for around $1000.

Bill

Here are the INF files.

;Module Name:
;
; MTIsaDrv.INF
;
;Abstract:
; INF file for installing MTIsaDrv driver
;
;–*/

[Version]
Signature=“$WINDOWS NT$”
Class=IODevice
ClassGuid={A5EC3DF5-9F66-4083-B86C-BB2B7F48316C}
Provider=%RTI%
DriverVer=11/18/2010,1.0.0.1
CatalogFile=MTIsaDrv.cat

[DestinationDirs]
DefaultDestDir = 12

; ================= Class section =====================

[ClassInstall32]
Addreg=IODeviceClassReg

[IODeviceClassReg]
HKR,0,%ClassName%
HKR,Icon,-5
HKR,DeviceCharacteristics,0x10001,0x100 ;Use same security checks on relative opens
HKR,Security,“D:P(A;;GA;;;SY)(A;;GA;;;BA)” ;Allow generic all access to system and built-in Admin.

;[IODeviceClassReg.Security]
;“D:P(A;;GA;;;WD)(A;;GA;;;SY)(A;;GA;;;BA)”

; ================= Device Install section =====================

[Manufacturer]
%RTI%=RTI,NTx86

; For XP and later
[RTI.NTx86]
%MTIsaDrv.DRVDESC%=MTIsaDrv_Inst,root\MTIsaDrv

[MTIsaDrv_Inst.NT]
CopyFiles=MTIsaDrv.CopyFiles
;LogConfig=MTIsaDrv.LC0, MTIsaDrv.LC1
LogConfig=MTIsaDrv.NT.FactDef

[MTIsaDrv.CopyFiles]
MTIsaDrv.sys

[MTIsaDrv_Inst.NT.Services]
AddService=MTIsaDrv,0x00000002,MTIsaDrv_Service

;Uncomment following lines if your device can only work with factory default settings
[MTIsaDrv.NT.FactDef]
ConfigPriority=HARDRECONFIG
IOConfig=300-302(3ff::slight_smile: ; 10 bit decode ranging from 300 - 302

;[MTIsaDrv.LC0]
;ConfigPriority=DESIRED
;IOConfig=300-302(3ff::slight_smile: ; 10 bit decode ranging from 300 - 302

;[MTIsaDrv.LC1]
;ConfigPriority=NORMAL
;IOConfig=3@300-3ff(3ff::slight_smile: ; 3 ports starting anywhere between 300 and 3fc

[MTIsaDrv_Service]
DisplayName = %MTIsaDrv.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\MTIsaDrv.sys

[SourceDisksFiles]
MTIsaDrv.sys=1,

[SourceDisksNames]
1 = %DiskId1%,“”

; DONE ADDING NEW ----------------------------
[Strings]
RTI = “Robson Technologies Inc.”
ClassName = “Multitrace Driver”
MTIsaDrv.SVCDESC = “MTIsaDrv”
MTIsaDrv.DRVDESC = “MTIsaDrv Driver”
DiskId1 = “MTIsaDrv Install Disk”

*********************Start of 2nd File inpout32.inf ******************

;Module Name:
;
; InpOut32.INF
;
;Abstract:
; INF file for installing inpout32 parallel port driver
;
;–*/

[Version]
Signature=“$WINDOWS NT$”
Class=IODevice
ClassGuid={A5EC3DF5-9F66-4083-B86C-BB2B7F48316C}
Provider=%RTI%
;DriverPackageType=Legacy
;DriverDisplayName=%InpOut32.DRVDESC%
DriverVer=11/18/2010,1.0.0.1
CatalogFile=inpout32.cat

[DestinationDirs]
DefaultDestDir = 12

; ================= Class section =====================

[ClassInstall32]
Addreg=IODeviceClassReg
;CopyFiles=InpOut32.CopyFiles

[IODeviceClassReg]
HKR,0,%ClassName%
HKR,Icon,-5
HKR,DeviceCharacteristics,0x10001,0x100 ;Use same security checks on relative opens
HKR,Security,“D:P(A;;GA;;;SY)(A;;GA;;;BA)” ;Allow generic all access to system and built-in Admin.

; ================= Device Install section =====================

[Manufacturer]
%RTI%=RTI,NTx86

; For XP and later
[RTI.NTx86]
%InpOut32.DRVDESC%=InpOut32_Inst,root\InpOut32

[InpOut32_Inst.NT]
CopyFiles=InpOut32.CopyFiles

[InpOut32.CopyFiles]
InpOut32.sys

[InpOut32_Inst.NT.Services]
AddService=InpOut32,0x00000002,InpOut32_Service

[InpOut32_Service]
DisplayName = %InpOut32.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\InpOut32.sys

[SourceDisksFiles]
InpOut32.sys=1,

[SourceDisksNames]
1 = %DiskId1%,“”

; DONE ADDING NEW ----------------------------
[Strings]
RTI = “Robson Technologies Inc.”
ClassName = “Multitrace Driver”
InpOut32.SVCDESC = “InpOut32”
InpOut32.DRVDESC = “InpOut32 Driver”
DiskId1 = “InpOut32 Install Disk”

OK, a bit more information dug up. If I turn on “Show Hidden Devices” in Device Manager on the machine where both drivers install, the MTIsaDrv driver shows up, but not the other under “Non-Plug and Play Drivers”. When installed by the Add Hardware Wizard, the drivers show up in a new category. I believe it was “MultiTrace”, but it may have been “IODevice” (I forget which one) and they showed up without turing on hidden devices.

Looking in the registry, MTIsaDrv appears under HKLM\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_MTISADRV, there is no Enum key for inpout32. I assume the Enum keys defines what shows up in the Device Manager. Why is one getting an Enum key and the other isn’t?

What a deep, thick, profound confusion.
Both these drivers are PnP, root enumerated. What this has to do with the “legacy mode” of DPinst?
Were these devices installed before dpinst run?

–pa

xxxxx@fastmail.fm wrote:

What a deep, thick, profound confusion.
Both these drivers are PnP, root enumerated. What this has to do with the “legacy mode” of DPinst?

In DPInst, “legacy mode” means “allow non-WHQL drivers”. They made up
their own unique definition of the term.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

On 11/24/10 10:32 AM, xxxxx@fastmail.fm wrote:

What a deep, thick, profound confusion.
Both these drivers are PnP, root enumerated. What this has to do with the “legacy mode” of DPinst?
Were these devices installed before dpinst run?

OK, now I’m a bit confused. Neither driver are PnP. They are legacy
drivers. The ISA card was designed in the 1980s before PnP existed.

Hardware was installed before DPInst ran.

Bill

These INF files specify root-enumerated hardware IDs:

root\InpOut32
root\MTIsaDrv

Legacy drivers (not on the dpinst meaning of legacy) are not associated with
any hardware IDs, they just create some devices and possibly grab
whatever hardware resources they can reach.
From installation POV, legacy driver is simply a service.

To install a PnP driver and make it run you need an existing device (PDO).
Someone needs to make up the root enumerated device.
“Devcon install” will do this. But dpinst?

–pa

I think you are running up against the fact that DIFx tools (dpinst and
related) are able to install PnP drivers for PnP devices.

They can also install a ‘kernel service’ driver that is not associated with
a device.

Your drivers, however, are ‘legacy’ (non-PNP) *device* drivers which
probably need some other mojo to get both the *device* and the *driver*
installed and understood by Windows.

I don’t know what that mojo is but the Add Hardware Wizard knows how to do
it and it probably involves a fair bit more work than what dpinst is willing
to do.

Going back to the result after installing with Add Hardware Wizard:

You noted that in this case a ‘device’ shows up in device manager. What are
the properties of this device (class, device ID, enumerator, etc.)?

Perhaps that information will give you some clue as to what SetupDi() work
needs to be done to install your non-PnP *device* and non-PnP *driver* on
it.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bill Olson
Sent: Wednesday, November 24, 2010 6:21 PM
To: Windows System Software Devs Interest List
Cc: xxxxx@fastmail.fm
Subject: Re: [ntdev] DPInst Installer Question

On 11/24/10 10:32 AM, xxxxx@fastmail.fm wrote:

What a deep, thick, profound confusion.
Both these drivers are PnP, root enumerated. What this has to do with the
“legacy mode” of DPinst?
Were these devices installed before dpinst run?

OK, now I’m a bit confused. Neither driver are PnP. They are legacy
drivers. The ISA card was designed in the 1980s before PnP existed.

Hardware was installed before DPInst ran.

Bill


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

In this case, my guess is that the add new hw wizard is doing exactly what devcon install xxx.inf is doing, create a root enumerated devnode

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Wednesday, November 24, 2010 3:54 PM
To: Windows System Software Devs Interest List
Cc: xxxxx@fastmail.fm
Subject: RE: [ntdev] DPInst Installer Question

I think you are running up against the fact that DIFx tools (dpinst and
related) are able to install PnP drivers for PnP devices.

They can also install a ‘kernel service’ driver that is not associated with a device.

Your drivers, however, are ‘legacy’ (non-PNP) device drivers which probably need some other mojo to get both the device and the driver installed and understood by Windows.

I don’t know what that mojo is but the Add Hardware Wizard knows how to do it and it probably involves a fair bit more work than what dpinst is willing to do.

Going back to the result after installing with Add Hardware Wizard:

You noted that in this case a ‘device’ shows up in device manager. What are the properties of this device (class, device ID, enumerator, etc.)?

Perhaps that information will give you some clue as to what SetupDi() work needs to be done to install your non-PnP device and non-PnP driver on it.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bill Olson
Sent: Wednesday, November 24, 2010 6:21 PM
To: Windows System Software Devs Interest List
Cc: xxxxx@fastmail.fm
Subject: Re: [ntdev] DPInst Installer Question

On 11/24/10 10:32 AM, xxxxx@fastmail.fm wrote:
> What a deep, thick, profound confusion.
> Both these drivers are PnP, root enumerated. What this has to do with
> the
“legacy mode” of DPinst?
> Were these devices installed before dpinst run?

OK, now I’m a bit confused. Neither driver are PnP. They are legacy drivers. The ISA card was designed in the 1980s before PnP existed.

Hardware was installed before DPInst ran.

Bill


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doron,

What happens when (and if) this legacy .SYS driver is loaded by PnP and no
AddDevice() routine is found?

Is that how a DriverEntry() created DO ‘legacy’ driver is activated in the
system now? By having a root enumerated PDO that never gets an FDO?

Just curious. I tossed all the ISA gear years ago. :slight_smile:

Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, November 24, 2010 7:00 PM
To: Windows System Software Devs Interest List
Cc: xxxxx@fastmail.fm
Subject: RE: [ntdev] DPInst Installer Question

In this case, my guess is that the add new hw wizard is doing exactly what
devcon install xxx.inf is doing, create a root enumerated devnode

d

IIRC, if a legacy driver is loaded as a pnp driver (or at least with the intent of being slapped onto a devnode), and does not fill out an AddDevice callback and does not create a devobj in DriverEntry, it is unloaded. If there is no AddDevice and it does create a devobj, I don’t remember what happens, but I don’t think anything errors out. The legacy / NT4 driver model still remains intact (in fact, wdf01000.sys itself is a legacy driver in that regard :slight_smile: ), DriverEntry is called and you create device objects. This is the model for net start/stop of legacy drivers.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Wednesday, November 24, 2010 4:04 PM
To: Windows System Software Devs Interest List
Cc: xxxxx@fastmail.fm
Subject: RE: [ntdev] DPInst Installer Question

Doron,

What happens when (and if) this legacy .SYS driver is loaded by PnP and no
AddDevice() routine is found?

Is that how a DriverEntry() created DO ‘legacy’ driver is activated in the system now? By having a root enumerated PDO that never gets an FDO?

Just curious. I tossed all the ISA gear years ago. :slight_smile:

Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, November 24, 2010 7:00 PM
To: Windows System Software Devs Interest List
Cc: xxxxx@fastmail.fm
Subject: RE: [ntdev] DPInst Installer Question

In this case, my guess is that the add new hw wizard is doing exactly what devcon install xxx.inf is doing, create a root enumerated devnode

d


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

xxxxx@fastmail.fm wrote:

To install a PnP driver and make it run you need an existing device (PDO).
Someone needs to make up the root enumerated device.
“Devcon install” will do this. But dpinst?

DPInst installs the driver PACKAGE. It copies the files into the driver
store. It then does an update, so if there are any devices waiting for
a driver, the newly installed driver package can match it. DPInst never
creates PDOs. That’s not its job.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

On 11/24/10 3:59 PM, Doron Holan wrote:

In this case, my guess is that the add new hw wizard is doing exactly
what devcon install xxx.inf is doing, create a root enumerated
> devnode

I’m still new to all this, but I have learned that the Add Hardware
Wizard is not doing exactly what devcon does. I tried the devcon route
before I tried DPInst. Someone here informed me that devcon only works
with PnP drivers. This was after I took the source for devcon and tried
to create my own installer. The program failed on a PnP call (I forget
the name of the function, it was long and had PnP in the name of it).

Add Hardware is obviously doing something that the other tools don’t do.
Though I don’t know what exactly that is.

Bill