INF file with more than one matching model

Hi all,

I have to support a four-port serial PCI card which comes in different
physical appearances (all four or less than four ports may be externally
connected), which however cannot be distiguished by software. The
optimization of not installing useless COM ports (ports which can be
opened, but to which nothing can be attached) is burdened on the end user.

To achieve this, the INF file for the card has a models section with
several devices, where the device ID is always the same, but the
descriptions are different, indicating the number of ports, and of
course pointing at different install sections.

This used to work fine on 2000 and XP, and after I added a setup
application built around DriverPackagePreinstall() and
InstallSelectedDriver(), it worked reasonably well for Vista and 7, too.
Now with Windows 8, it won’t work any more: No matter what model is
selected, it’s always the same model that gets actually installed. And
it’s apparently not just a bug in my setup program: If I try to change
the model using device manager and “Update driver”, Windows claims to
have accepted my choice, but in reality has installed the “default”
driver again.

Here’s the final part of the Win8 SetupApi.log:

sto: {Configure Driver Package: exit(0x00000000)}
dvi: Install Device: Configuring device
(oem9.inf:pci\ven_1415&dev_9501,Bla_9501_2). 15:42:57.775
dvi: Install Device: Configuring device completed.
15:42:57.791
dvi: Install Device: Removing device sub-tree.
15:42:57.791
dvi: Install Device: Removing device sub-tree
completed. 15:42:57.932
dvi: Install Device: Restarting device. 15:42:57.932
dvi: Install Device: Restarting device completed.
15:42:57.963
ndv: {Core Device Install - exit(0x00000000)} 15:42:57.979
ump: {Plug and Play Service: Device Install exit(00000000)}
dvi: {DIF_NEWDEVICEWIZARD_FINISHINSTALL} 15:42:58.010
dvi: No class installer for ‘Serial PCI card, 2/4’
dvi: No CoInstallers found
dvi: Default installer: Enter 15:42:58.026
dvi: Default installer: Exit
dvi: {DIF_NEWDEVICEWIZARD_FINISHINSTALL - exit(0xe000020e)}
15:42:58.026
ndv: {Update Driver Software Wizard exit(00000000)}
<<< Section end 2012/10/01 15:43:03.859
<<< [Exit status: SUCCESS]

Where “Bla_9501_2” is the name of the section that I selected, and
“Serial PCI card, 2/4” is the corresponding display name. But what gets
installed has the properties from section “Bla_9501_1”, and device
manager displays it as “Serial PCI card, 1/4”, too.

0xe000020e is only DI_DO_DEFAULT, which shouldn’t be a problem, right?
Anything else that is unusual here?

Use different Subsystem ID in PCI config for different variants of the card.

xxxxx@broadcom.com wrote:

Use different Subsystem ID in PCI config for different variants of the card.

Thanks, that would have been a nice idea ten years ago, when this PCI
card was designed.

More seriously, if it should turn out that Windows 8 finally ruined a
lame design that just deserved to die, there already is one redesign
that I am considering: Let the INF file install the card with always
just one COM port, and have a custom property page in the device manager
to adjust the number of ports.

But I was hoping for opinions why Winodws 8 won’t respect the selected
install section, when all previous versions of Windows did. Do I need a
CoInstaller?

>Thanks, that would have been a nice idea ten years ago, when this PCI card was designed.

You don’t have a NVRAM for the config info?

So how the users are supposed to select the model to install? Does your INF
have ExcludeFromSelect statement?

How about this: since all “active” ports are connected, make up some
heurisctic for the driver to
detect connected ports - by reading CTS or other pins. Kind of what serenum
does.
Later, when asked for PnP state, return error for disconnected ports and
they will disappear.
A coinstaller can be useful.
– pa

“Wilhelm Nöker” wrote in message news:xxxxx@ntdev…
>
> More seriously, if it should turn out that Windows 8 finally ruined a lame
> design that just deserved to die, there already is one redesign that I am
> considering: Let the INF file install the card with always just one COM
> port, and have a custom property page in the device manager to adjust the
> number of ports.
>
> But I was hoping for opinions why Winodws 8 won’t respect the selected
> install section, when all previous versions of Windows did. Do I need a
> CoInstaller?
>

Pavel A. wrote:

So how the users are supposed to select the model to install? Does your
INF have ExcludeFromSelect statement?

Well, it has an InteractiveInstall statement, if that’s what you meant?
Like I said, using “Update driver” in the device manager, I can see all
the models that I’d expect, and the contents of the SetupApi.log shows
that the device manager at least understood which model I selected. It’s
just that on Windows 8, in contrast to all previous Windows versions,
the wrong (and always the same) driver gets installed.

Frankly, this looks like a bug in Windows 8 to me. Or, more carefully
phrased, like there has been a rule change that I’m not aware of in some
part of the setup API. (And I’ve already stumbled across one such rule
change: For Windows 8, your driver package must at least have a
self-signed CAT file, or it won’t get installed, period. This caught me
by surprise, because so far I wasn’t aware that a self-signed CAT file
had any benefit at all, anywhere.)

How about this: since all “active” ports are connected, make up some
heurisctic for the driver to
detect connected ports - by reading CTS or other pins. Kind of what
serenum does.

Erm… By “externally connected” I meant “has line drivers and a DB9
connector attached”. The basic version of this card comes with two
external connectors only, and the user may choose to install an
additional slot bracket with ribbon cables and two more external
connectors. Whether or not he has done that definitely cannot be
detected by software.

I talked to our hardware designer, and the UART chip that we use would
have made it easy (with a “hardwired subsystem ID” feature) to have the
PCI subsystem ID controlled by jumpers. Then we could have told our
users: “When installing the extra slot bracket, make sure to set this
jumper, so that the additional ports are recognized by the driver”.

It’s a pity that we didn’t do that back then, but it doesn’t look like
we’ll change it now, after all these years. These are not consumer PCI
cards, after all, but for industry use, and it seems that our customers
never really complained about this little flaw in the plug & play
experience. (Or, less politely said, about our stupid hardware/software
package that doesn’t just *know* the correct number of ports.)

A coinstaller can be useful.

Well, all I need to do is create a registry entry indicating the correct
number of ports to the driver, before it is started for the first time.
Until now, this was done by executing one of several install sections
from the INF file. And if Windows 8 won’t let me do that anymore (for
whatever reason), then a coinstaller would be my next best choice, right?

If you will use the subsystem ID approach, this is all you need.
Create separate sections for each subsystem ID in the INF file,
with its appropriate registry entries, and remove InteractiveInstall
(I’ve even did not know that win7 still supports InteractiveInstall!
yes, they’ve changed the rules).

However, note that if the registry entries are in the common service key
(rather than in per-device keys), they may be left out of sync. For
example, suppose the user plugs in the variant A of the card, then
variant B, then A again - the registry entries may remain from variant B
because A will be detected as a known returning instance and won’t be
reinstalled.

Regards,
– pa

On 04-Oct-2012 15:14, Wilhelm Nöker wrote:

Pavel A. wrote:

> So how the users are supposed to select the model to install? Does your
> INF have ExcludeFromSelect statement?

Well, it has an InteractiveInstall statement, if that’s what you meant?
Like I said, using “Update driver” in the device manager, I can see all
the models that I’d expect, and the contents of the SetupApi.log shows
that the device manager at least understood which model I selected. It’s
just that on Windows 8, in contrast to all previous Windows versions,
the wrong (and always the same) driver gets installed.

Frankly, this looks like a bug in Windows 8 to me. Or, more carefully
phrased, like there has been a rule change that I’m not aware of in some
part of the setup API. (And I’ve already stumbled across one such rule
change: For Windows 8, your driver package must at least have a
self-signed CAT file, or it won’t get installed, period. This caught me
by surprise, because so far I wasn’t aware that a self-signed CAT file
had any benefit at all, anywhere.)

> How about this: since all “active” ports are connected, make up some
> heurisctic for the driver to
> detect connected ports - by reading CTS or other pins. Kind of what
> serenum does.

Erm… By “externally connected” I meant “has line drivers and a DB9
connector attached”. The basic version of this card comes with two
external connectors only, and the user may choose to install an
additional slot bracket with ribbon cables and two more external
connectors. Whether or not he has done that definitely cannot be
detected by software.

I talked to our hardware designer, and the UART chip that we use would
have made it easy (with a “hardwired subsystem ID” feature) to have the
PCI subsystem ID controlled by jumpers. Then we could have told our
users: “When installing the extra slot bracket, make sure to set this
jumper, so that the additional ports are recognized by the driver”.

It’s a pity that we didn’t do that back then, but it doesn’t look like
we’ll change it now, after all these years. These are not consumer PCI
cards, after all, but for industry use, and it seems that our customers
never really complained about this little flaw in the plug & play
experience. (Or, less politely said, about our stupid hardware/software
package that doesn’t just *know* the correct number of ports.)

> A coinstaller can be useful.

Well, all I need to do is create a registry entry indicating the correct
number of ports to the driver, before it is started for the first time.
Until now, this was done by executing one of several install sections
from the INF file. And if Windows 8 won’t let me do that anymore (for
whatever reason), then a coinstaller would be my next best choice, right?