Componentize printer drivers so that they auto-install with plug and play.

S

steves

Hello all,

I am componentizing a number of USB printer drivers (HP Laserjets) and
I want the printers to respond automatically to plug and play when
connected

I have found (after much searching) that I can get the drivers to
successfully install using the "Automatically Detect and install my
Plug and Play printer" with no prompting, if I do the following:

a) Copy the files from the HP install CD folders English\Drivers\*.*
onto the target at a given folder, for example:
C:\Drivers\HPLJ_1022.

b) Update the "DevicePath" registry Key, which is found at
[HKLM\Software\Microsoft\Windows\CurrentVersion]
; "DevicePath"="%SystemRoot%\Inf" <- (Default, before editing)
; After Editing:
"DevicePath"="%SystemRoot%\inf;%SystemDrive%\Drivers\HPLJ_1022"

So far so good.
Now I'm trying to componentize this, so

For a) I set the component "Files" resources path to
"%24%\Drivers\HPLJ_1022"

QUESTION 1: Predefined environment variable %24% is "Boot Drive", is
there a better one to use that equates to "%SystemDrive%"??? "%30%??

For b) I add a registry data to the component, and set the "Advanced"
write options to "Always Edit the value", but I find that after
building the actual registry value only contains %SystemDrive%\INF. (I
did not change the default build order).

QUESTION 2: Is there a way that I can have each printer have it's own
component with a single "RegistryData" resource that ADDS a new value
to this RegExpand_SZ value?
 
K

KM

1)
a) %30% (or %systemdrive%) and %24% are not necessarily equal. Boot and
System disks (partitions) may be different volumes.

Read more about how to use DirIds here:
http://msdn2.microsoft.com/en-gb/library/ms790174.aspx

b) There are other components in your config that overwrite that value in
registry. Either set the build order of your component to late number, or
set the build dependency for the component to be built after all the
components that may changes the same registry value.

2) I assume you're talking about a few printer components that may all be
added to the same config? The answer is - possible. However, to deal with
the substrings of particular registry value during build time you will have
to write a custom CMI script that will parse the value and merge it with the
new subvalues. (search this NG archive to learn more about undocumented CMI
interfaces)

Regards,
KM
 
S

steves

Thanks KM,

As usual your assumptions and instructions are right on.


SteveS
StevesATeyeDASHimagingDOTcom

1)
a) %30% (or %systemdrive%) and %24% are not necessarily equal. Boot and
System disks (partitions) may be different volumes.

Read more about how to use DirIds here:
http://msdn2.microsoft.com/en-gb/library/ms790174.aspx

b) There are other components in your config that overwrite that value in
registry. Either set the build order of your component to late number, or
set the build dependency for the component to be built after all the
components that may changes the same registry value.

2) I assume you're talking about a few printer components that may all be
added to the same config? The answer is - possible. However, to deal with
the substrings of particular registry value during build time you will have
to write a custom CMI script that will parse the value and merge it with the
new subvalues. (search this NG archive to learn more about undocumented CMI
interfaces)

Regards,
KM
Hello all,

I am componentizing a number of USB printer drivers (HP Laserjets) and
I want the printers to respond automatically to plug and play when
connected

I have found (after much searching) that I can get the drivers to
successfully install using the "Automatically Detect and install my
Plug and Play printer" with no prompting, if I do the following:

a) Copy the files from the HP install CD folders English\Drivers\*.*
onto the target at a given folder, for example:
C:\Drivers\HPLJ_1022.

b) Update the "DevicePath" registry Key, which is found at
[HKLM\Software\Microsoft\Windows\CurrentVersion]
; "DevicePath"="%SystemRoot%\Inf" <- (Default, before editing)
; After Editing:
"DevicePath"="%SystemRoot%\inf;%SystemDrive%\Drivers\HPLJ_1022"

So far so good.
Now I'm trying to componentize this, so

For a) I set the component "Files" resources path to
"%24%\Drivers\HPLJ_1022"

QUESTION 1: Predefined environment variable %24% is "Boot Drive", is
there a better one to use that equates to "%SystemDrive%"??? "%30%??

For b) I add a registry data to the component, and set the "Advanced"
write options to "Always Edit the value", but I find that after
building the actual registry value only contains %SystemDrive%\INF. (I
did not change the default build order).

QUESTION 2: Is there a way that I can have each printer have it's own
component with a single "RegistryData" resource that ADDS a new value
to this RegExpand_SZ value?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top