PC Review


Reply
Thread Tools Rate Thread

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

 
 
steves
Guest
Posts: n/a
 
      17th Jan 2007
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?

 
Reply With Quote
 
 
 
 
KM
Guest
Posts: n/a
 
      17th Jan 2007
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?
>



 
Reply With Quote
 
steves
Guest
Posts: n/a
 
      17th Jan 2007
Thanks KM,

As usual your assumptions and instructions are right on.


SteveS
StevesATeyeDASHimagingDOTcom


KM wrote:
> 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?
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Plug&Play Drivers MikeB Windows Vista General Discussion 4 5th Jan 2009 07:20 PM
how to install drivers to unrecognised plug and play devices =?Utf-8?B?QWxiZXJ0VGVhY2FrZQ==?= Windows XP General 2 3rd Apr 2007 05:00 PM
Plug and Play Drivers WilliamP Windows XP General 0 10th Oct 2004 12:20 AM
.Plug & Play Drivers W de Villiers Windows XP Setup 0 21st May 2004 12:40 PM
Non-Plug and Play Drivers Amit Windows XP Embedded 1 4th Mar 2004 04:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:24 PM.