360 likes | 630 Views
Deploying Device Drivers On Windows Vista. Farhan Ahmed Software Design Engineer Microsoft Corporation. Main Points. Phases of Setup relevant to driver deployment Generalize and Specialize phases Driver migration and driver ranking Troubleshooting driver deployment issues.
E N D
Deploying Device Drivers On Windows Vista Farhan Ahmed Software Design Engineer Microsoft Corporation
Main Points • Phases of Setup relevant to driver deployment • Generalize and Specialize phases • Driver migration and driver ranking • Troubleshooting driver deployment issues Look out for these for important notes!
You Should Be Interested If … • You want to optimize driver deployment • You want to reduce support costs • You want to learn about the driver deployment process
WinPE Relevant phases of Setup • WinPE • offlineServicing • auditSystem / auditUser • offlineServicing • auditSystem / auditUser Text mode setup has been deprecated
The Basics • Driver paths are specified in an ‘Unattend’ answer file • We recursively search paths and add driver packages Setting ‘DevicePath’ key during Setup is not supported in Windows Vista
Sample Section <unattendxmlns="urn:schemas-microsoft-com:asm.v3" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> <settings pass="windowsPE"> <component name="Microsoft-Windows-PnpCustomizationsWinPE"> <DriverPaths> <PathAndCredentialswcm:keyValue="1"> <Path>\\share\Drivers\</Path> <Username>TestUser</Username> <Password>TestPassword</Password> <Domain>TestDomain</Domain> </PathAndCredentials> </DriverPaths> </component> </settings> </unattend>
WinPE Phase • Happens before WinPE is loaded • Can add boot-critical drivers to system • Add driver packages are added to WinPE image and target image Offline WinPE image Offline target image Driver packages
OfflineServicing Phase • Drivers injected into the offline target image • Can add boot-critical drivers to the target image WinPE 2.0 Offline target image Driver packages
AuditSystem/AuditUser Phase • Target image online • Can add machine specific drivers Vista/LHS Online Driver Store Driver packages Phase runs only if you boot into ‘audit’ mode
Adding Only Relevant Drivers • Code imports all driver packages found • Use scripted DPInst.exe with the /SH flag in the auditUser phase • Refer to the driver deployment whitepaper for more information DPInst is a re-distributable available with the DIFx package
Adding Drivers Manually • Offline • Use PkgMgr from the command line • Refer to the OPK/WAIK documentation • Online • Use PnPUtil in %windir%\system32\ • Use ‘-i’ flag to install drivers on devices
Technique • Similar to ‘$OEM$’ directory functionality in Windows XP • Directory name changed to ‘$WinPEDriver$’ • Useful for storing boot-critical drivers on OS-less systems WinPE 2.0 Offline Target Image $WinPEDriver$ Answer file
What Are These? • Passes in Setup that prep the image for deployment to a system • ‘Generalize’ removes system specific information from the image • ‘Specialize’ adds system specific information to the image
'Generalize' And Devices • Plug and Play plugin runs in the ‘Generalize’ pass of Setup to: • Remove all device specific information • Re-enable all boot-critical drivers • Can use ‘PersistAllDeviceInstalls’ option to keep all devices installed • IMPORTANT: Should only be used when image is to be applied to an identical system
'Specialize' And Devices • Plug and Play plugin runs in the ‘Specialize’ pass of Setup to • Remove phantom devices • Disable all boot-critical drivers that do not apply to the current system
Driver Migration • Process to ‘migrate’ drivers from down-level Operating System (OS) to Windows Vista • Seamless experience for customers • Driver packages need to be ‘deployable’ • Must reference all files in INF • Must set all registry settings via INF Refer to talk titled ‘Building Deployable Driver Packages’
Driver Migration 2006-11-11 13:55:14, Info [0x0805e6] MIG Trying to reassemble 'oem3.inf’ () 2006-11-11 13:55:14, Info [0x0805e6] MIG Found 1 devices using 'oem3.inf'. () 2006-11-11 13:55:14, Info [0x0805e6] MIG DriverDesc: 'ABCSound Integrated Digital Audio' () 2006-11-11 13:55:14, Info [0x0805e6] MIG InfSection: 'WDM_R4_0' () 2006-11-11 13:55:14, Info [0x0805e6] MIG InfSection decoration: 'WDM_R4_0.NT' () 2006-11-11 13:55:14, Info [0x0805e6] MIG MatchingDeviceId: 'pci\ven_8086&dev_24c5&subsys_05541014' () 2006-11-11 13:55:14, Info [0x0805e6] MIG DriverDate: '10-27-2003' () 2006-11-11 13:55:14, Info [0x0805e6] MIG DriverVersion: '5.12.1.3624' () 2006-11-11 13:55:14, Info [0x0805e6] MIG Found 1 different install sections in 'oem3.inf'. () 2006-11-11 13:55:14, Info [0x0805e6] MIG File 'b4d.dll' found at 'C:\WINDOWS\system32'. () 2006-11-11 13:55:14, Info [0x0805e6] MIG File 'bfaudio.sys' found at 'C:\WINDOWS\system32\drivers'. () 2006-11-11 13:55:14, Info [0x0805e6] MIG File 'abcsens.sys' found at 'C:\WINDOWS\system32\drivers'. () 2006-11-11 13:55:14, Info [0x0805e6] MIG File 'abcwdm.sys' found at 'C:\WINDOWS\system32\drivers'. () 2006-11-11 13:55:14, Info [0x0805e6] MIG Catalog file 'ABCSound.cat' found at 'C:\WINDOWS\system32\CatRoot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}\oem3.CAT'. () 2006-11-11 13:55:14, Info [0x0805e6] MIG Driver package will be copied to 'C:\$UPGRADE.~OS\ReassembledDrivers\oem3_260CAD5C34B710865BA3FBDA57872CAD61E73988' () 2006-11-11 13:55:15, Info [0x0805e6] MIG copied catalog file
Packages Not Migrated • Printer class driver packages • Windows XP Inbox drivers • Drivers flagged as being incompatible • Corrupt or incomplete driver packages Refer to ‘Plug and Play Migration’ whitepaper on WHDC
The Basics • Adding driver to system does not mean it will be used • Inbox driver can “outrank” a newly added driver • Make sure to test your driver online before deploying it on an image to see if it is selected
The Rules • Driver Ranking takes into account • Signature • Plug and Play ID match • Driver Date • Driver Version • For detailed information, refer to the WDK documentation Most Windows Vista inbox drivers have a driver date of 6/21/2006
Play The Ranking Game! Driver A Driver B versus Signed Compatible ID match 6/21/2006 6.0 Unsigned Hardware ID match 3/26/2007 7.0 Driver C Driver D versus Signed Hardware ID match 6/21/2006 6.0 Signed Compatible ID match 2/10/2007 1.0
Play The Ranking Game! Driver A Driver B versus Unsigned HardwareID match 1/21/2007 6.0 Unsigned Hardware ID match 3/26/2007 5.0 Driver C Driver D versus Signed Hardware ID match 2/10/2006 1.0 Signed Compatible ID match 2/10/2006 2.0
Useful Information • Driver Package • setupapi.*.log files from %windir%\inf • For device installation issues on online system • setupact.log from %windir%\panther • For Setup related issues
Useful Information • Error codes from Device Manager • E.g. ‘Code 28’ • Hardware and Compatible IDs from the device • Device -> Properties -> Hardware IDs
Call To Action • Test all driver packages online before deployment during Setup • Collect all relevant log files for diagnostic purposes • Author driver packages such that they are easily migrated
Additional Resources • Web Resources • Device Driver Deployment Whitepaper • http://www.microsoft.com/whdc • Driver Installation on the WHDC Web Site • http://www.microsoft.com/whdc/driver/install/default.mspx • Plug and Play Device Driver Migration in Windows Vista • http://www.microsoft.com/whdc/driver/install/Pnpmigration.mspx • Newsgroup • microsoft.public.development.device.drivers • Other Resources • Windows Automatic Installation Kit Documentation • Related Sessions • DVR-C398: Device Driver Installation Basics • DVR-T393: Building Deployable Driver Packages • DVR-T396: Common Device Install Errors
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.