Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


kiwidj

Win7 PNP Driver Staging without using DISM?

Recommended Posts

Hi,

I'm currently working on a hardware independent Windows 7 image using HTA/vbscript to control process of deployment and perform hardware identification then apply a specific driver set depending on the detected hardware.

I don't want to include all drivers into the reference image as this will slow the deployment time as additional support for hardware is provided. In an ideal world I would use DISM to inject the drivers into the offline image after it has been applied - however I'm not able to do this as DISM will not run in a Windows PE 2.1 environment (and WinPE3.0 is not an option right now).

Currently:

•I have an automated reference image task sequence and a separate deploy image task sequence.

•I have prepared and applied the Win7 image using imagex, then I am copying the correct device drivers to the local harddrive.\

•the machine builds using the unattend.xml although drivers are not installed for all devices since it cannot find the local drivers.

So my options now are (in order of preference that I can think of..):

1. Provide some way in the tell the unattend.xml / Win7 to use the new drivers on the local hardrive (C:\drivers) early during windows setup.

2. Run a first logon command to install these new drivers from the local hard drive - this isn't ideal as it would mean video drivers would not be installed until a good way through the setup sequence.

At the moment in the unattend.xml I have setup in Offline Servicing the path to the drivers (c:\drivers) but this is not processed from this directory since the machine is not in an offline state by the time I'm deploying the image.

It looks like I may be able to use pnputil to do import the drivers into the driver store, not sure if this is the best way though and also not sure how I force a full rescan to update all drivers afterwards?

Any ideas what my options I have?

In 2000/XP/2003 this was a simple as a few registry tweaks to specify the path and copying drivers into said path..

Thanks!

Share this post


Link to post
Share on other sites

AFAIK this cannot be done with anything but DISM. But that doesn't mean you need to do it from WinPE. (DISM can be used online as well)

Since you cannot move to PE 3.0, you best bet is to use "SetupComplete.cmd" to integrate them, and reboot the machine. This will delay the first login until after the reboot, guaranteeing that all drivers (including video)are available on first boot, just like if they had been integrated offline.

DISM.exe /Online /Add-Driver /Driver:C:\Drivers /Recurse

shutdown -r -t 0

Share this post


Link to post
Share on other sites

DISM.exe /Online /Add-Driver /Driver:C:\Drivers /Recurse

Thanks for the reply - sorry I should have mentioned I've tried using dism online to add drivers (just tried it again to confirm) but I get an error:50 'This command can only be used with an Offline image.'

However this is logged on as a user account - not sure if there behaviour differs when run using the 'SetupComplete.cmd'? (I assume the only difference will be the context the command is executed in (i.e. system for setupcomplete.cmd rather than user)

Share this post


Link to post
Share on other sites

Will you please attach, not paste, your XML file, and we will find out why it is not being read. First question, which pass are you running it from, it is only valid during the AuditSystem or OfflineServicing passes.

The other thing I want to check is the "Parent Heirarchy", it is very easy to mix them up. You want to be using the "NonWinPE" setting to install drivers into the OS.

Microsoft-Windows-PnpCustomizationsNonWinPE | DriverPaths

and not this one.

Microsoft-Windows-PnpCustomizationsWinPE | DriverPaths

Share this post


Link to post
Share on other sites

Will you please attach, not paste, your XML file, and we will find out why it is not being read. First question, which pass are you running it from, it is only valid during the AuditSystem or OfflineServicing passes.

The other thing I want to check is the "Parent Heirarchy", it is very easy to mix them up. You want to be using the "NonWinPE" setting to install drivers into the OS.

Microsoft-Windows-PnpCustomizationsNonWinPE | DriverPaths

and not this one.

Microsoft-Windows-PnpCustomizationsWinPE | DriverPaths

my understanding of when/how each phase runs is a little limited but because this will be a fully automated installation I'd like the driver installation to run in the Offline Servicing path rather than Audit system, you can see from the unattend.xml that I have driver paths specified in both but neither is being picked up at the moment.

I also have another basic unattend.xml which I use to build the base reference image and install the automation agent - which then installs core apps and patches - then sysprep's and shutdown and an image is captured..

then for deployment:

1. prepare the disk

2. apply the image

3. copy the deploy_unattend.xml

4. copy drivers

5. reboot to begin windows setup (I'm not running setup.exe from WinPE)

- actually this makes me think - does the driver path need to be in the reference unattend.xml also? (is the driver path still written to the registry like XP etc does?)

deploy_unattend.xml

Share this post


Link to post
Share on other sites

Easy fix. Change this

<Path>\drivers</Path>

to this

<Path>C:\drivers</Path>

Happens twice near the bottom. Then report back.

Edited by MrJinje

Share this post


Link to post
Share on other sites

Hi, I have adapted my existing vbscript 2003/XP unattended install to Windows 7/2008R2. Using XMLDOM my script edits a template autounattend.xml file and injects some entries (like hostname from the host database), then starts setup. I have the entire install working nicely but, like the thread starter, I can't get drivers integrated the 'old-fashioned' way (i.e. not using DISM).

I support too many hardware configs to inject all the drivers into the base image, I don't want multiple OS images because frankly there's no point, and I'd rather not use the AuditSystem pass and Sysprep if I can help it. They add plenty of additional complexity, and again are not really needed in my case.

As I understand it, I should be able simply to place some valid driver paths with credentials in OfflineServicing like so (I copied this from IE's XML viewer, so it's not the actual XML) and they should be soaked up into the machine's local driver store:

- <settings pass="offlineServicing">
- <component name="Microsoft-Windows-PnpCustomizationsNonWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <DriverPaths>
- <PathAndCredentials wcm:action="add" wcm:keyValue="2">
- <Credentials>
<Domain>mydomain.local</Domain>
<Password>mypassword</Password>
<Username>unattendeduser</Username>
</Credentials>
<Path>\\fileserver\drivers</Path>
</PathAndCredentials>
- <PathAndCredentials wcm:action="add" wcm:keyValue="3">
- <Credentials>
<Domain>mydomain.local</Domain>
<Password>mypassword</Password>
<Username>unattendeduser</Username>
</Credentials>
<Path>\\fileserver\drivers</Path>
</PathAndCredentials>
</DriverPaths>
</component>
</settings>

I thought this would have broadly the same effect as OEMPnpDriverPaths in XP/2003 (i.e. it would integrate my drivers in the offlineServicing pass) but it appears not. The drivers do not get installed. I tried using local paths without credentials too (and putting the drivers in $OEM$\$1) to no avail. If I later manually click Update Driver and browse to the driver path in specified above, the driver installs.

Reading about how MDT works on this problem seems to suggest my idea about how it should work is correct:

http://exec.typepad.com/airdesk/2009/10/windows-7-deployment-part-6.html

According to that post, the offlineServicing pass is indeed supposed to add any drivers that are found in the specified paths into the local driver store. Has anyone got this to work?

I have noticed that you can add an additional devicepath in the registry (http://technet.microsoft.com/en-us/library/dd919224(WS.10).aspx) but this doesn't solve my problem. Many integrated video cards for instance have Microsoft supplied drivers in Windows 7 which are old. Adding a devicepath to the registry after the machine is built won't cause them to be updated without manual intervention.

My final autounattend.xml (after editing by script) passes validation in WSIM so I don't think it's a syntax problem. I think I'm just not understanding the mechanisms properly.

In case it's relevant - the driver I'm testing with is a signed Intel Q965 display driver, and a SoundMax HD Audio (both for Dell Optiplex 745). Each time I test the build it is ignored and the standard Windows drivers are installed instead. Manually browse to those drivers after the machine is built and they are preferred over the Windows ones. It's as if offlineServicing never runs. Is that because I'm launching from my own Windows PE 3.0, and not Boot.wim? Is there any logging I can check?

Furthermore, I've compared my XML to this example autounattend.xml for offlineServicing and I still can't get any joy:

http://support.microsoft.com/kb/978226

Edited by patters

Share this post


Link to post
Share on other sites

Ok, a lot of reading and futile testing later, and I see that the guy who re-wrote ZTIDrivers.wsf for MDT2010 got it to copy the drivers locally, then add a devicepath, then invoke Sysprep.

http://deployment.xtremeconsulting.com/2009/10/28/how-to-debug-mdt-litetouchdriver-problems/

That to me would tend to imply that the offlineServicing pass doesn't work otherwise surely he would have used it.

EDIT - this Technet article seems to say that for a driver to be applied in offlineServicing, it first needs to be in the WinPE driver store. It then gets copied across from there. More testing in the morning...

Edited by patters

Share this post


Link to post
Share on other sites

Easy fix. Change this

<Path>\drivers</Path>

to this

<Path>C:\drivers</Path>

Happens twice near the bottom. Then report back.

Hi,

Unfortunately this does not work either, I actually changes the path to \Drivers because I read a technet forum user who solved the same issue by changing the path to this - unfortunately this is not working for me. I've also tried with C:\Drivers and %SYSTEMROOT%\Drivers without success.

After a lot more reading today it looks like the Offline Servicing isn't going to work with my deployment method (deploying a captured image without invoking setup.exe from PE) and I'm not sure about how I would go about automating AuditSystem in such a manner to achieve this either as I want all the drivers installed before an interactive user session (audit mode or otherwise) is presented..

however it looks like I've found a couple of methods that will work:

This first method uses 'pnpUnattend.exe AuditSystem [/L]'

by adding the PNPUnattend driverpath into the registry in the SetupComplete.cmd I can install all drivers prior to logon. this works okay but a black screen is displayed while setupcomplete runs and the driver installation takes a while (plus windows setup has already done this so it's doubling up driver installation time).

SetupComplete.cmd contents:

ECHO Configuring PNP Driver Installation..
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\UnattendSettings\PnPUnattend\DriverPaths\1" /v Path /t REG_SZ /d "C:\Drivers"

ECHO Installing PNPDeviceDrivers
C:\Windows\System32\pnpUnattend.exe AuditSystem /L

Secondly; The preferable way (for me at least) I've found is to edit the devicepath in the registry of the image being deployed to include my custom driver path, Windows Setup appears to scan this during minisetup and install the correct drivers from startup (installing devices phase)!

I still find it frustrating that it's had to come to this as I'd really like to have been able to do using the correct configuration (unattend.xml) files and without resorting to registry hacks / fixes..

Share this post


Link to post
Share on other sites

I use in offlineservicing same as you <Path>%systemdrive%\Drivers</Path>

only difference is I have not seen you say AutoUnattend.xml

Share this post


Link to post
Share on other sites

I think I've found the answer to my problem now that I'm aware of the log at %systemroot%\panther\setupact.log. I see:

PnPIBS: Finished reading driver paths from unattend.xml.
PnPIBS: Connecting to driver path \\myserver\UNATTENDED\drivers\7-x64\Dell745.drivers using credentials provided ...
PnPIBS: Error 0x4C3 occurred while connecting to driver path \\myserver\UNATTENDED\drivers\7-x64\Dell745.drivers. [gle=0x000004c3]
PnPIBS: WARNING: Could not access path \\myserver\UNATTENDED\drivers\7-x64\Dell745.drivers.

Error 0x4C3 (67 in decimal) is when you try to connect multiple times to shared resources on the same server from a single user context with multiple sets of credentials.

It's strange to see that because I'm using the same UPN login (user@domain) both for connecting to my unattended share (in my PE-based vbscript), and for adding into the XML so I don't really understand why it should fail. I can get around the problem by using the FQDN of the server in the autounattend.xml, thereby having Windows PE believe it's dealing with another distinct host.

...And I've verified that the offlineServicing pass now adds the drivers successfully!

Edited by patters

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...