Win10 1607 LTSB not finding drivers



  • I created an image based on the LTSB 1607 Windows 10. I can deploy it fine to the first of a fleet of new machines - Dell Latitude 5590’s.

    I have the fog.drivers script running after imaging, and the C:\Drivers folder is populated, so I know FOG is copying the drivers.

    However, Windows is not looking in that folder during the first boot up, and installing the drivers it needs.

    unattend.xml (the part that mentions the Driver path):

    ...
        <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="1">
                        <Path>C:\Drivers</Path>
                    </PathAndCredentials>
                </DriverPaths>
            </component>
        </settings>
    ...
    

    The tree of files created (trimmed):

    C:\
      Drivers\
        x64\
          audio\
          chipset\
    ...
          storage\
          video\
    

    fog.drivers Script:

    #!/bin/bash
    ceol=`tput el`;
    manu=`dmidecode -s system-manufacturer`;
    case $manu in
        [Ll][Ee][Nn][Oo][Vv][Oo])
            machine=$(dmidecode -s system-version)
            ;;
        *[Dd][Ee][Ll][Ll]*)
            machine=$(dmidecode -s system-product-name) #pruduct is typo, just realized sorry :(
            ;;
        *)
            machine=$(dmidecode -s system-product-name) # Technically, we can remove the dell one as it's the "default"
            ;;
    esac
    [[ -z $machine ]] && return #assuming you want it to break if it is not lenovo or dell?
    machine="${machine%"${machine##*[![:space:]]}"}" #Removes Trailing Spaces
    
    #############################################
    # Quick hack to find out if the installed OS image is a x86 or x64
    system64="/ntfs/Windows/SysWOW64/regedit.exe" # sloppy detect if 64bit or not
    [[ ! -f $system64 ]] && arch="x86" || arch="x64"
    
    #############################################
    #this section has been updated to bring the osn names in line
    # with how the Dell CABs are defined
    case $osid in
        5) osn="win7" ;;
        6) osn="win8" ;;
        7) osn="win8.1" ;;
        9) osn="win10" ;;
    esac
    
    #############################################
    dots "Preparing Drivers"
    # below creates local folder on imaged pc
    # this can be anywhere you want just remember
    # to make sure it matches throughout! (case IS important here)
    if [ $osid -eq 9 ]
    then
        clientdriverpath="/ntfs/Drivers"
    else
        clientdriverpath="/ntfs/Windows/inf/Drivers"
    fi
    remotedriverpath="/images/drivers/$machine/$osn/$arch"
    
    [[ ! -d $clientdriverpath ]] && mkdir -p "$clientdriverpath" >/dev/null 2>&1
    echo -n "In Progress"
    
    #there's 3 ways you could handle this,
    #driver cab file, extracted driver files or both
    #so on the server put extracted driver files to match below folder tree
    #i.e. Model Latitude E5410, Windows 7 x86 image would be:
    #/fog/Drivers/Latitude E5410/win7/x86
    
    rsync -aqz "$remotedriverpath" "$clientdriverpath" >/dev/null 2>&1
    [[ ! $? -eq 0 ]] && handleError "Failed to download driver information for [$machine/$osn/$arch]"
    
    #this next bit adds driver location on pc to devicepath in registry (so sysprep uses it to reference)
    # remember to make devicepath= match the path you've used locally
    #also do not remove %SystemRoot%\inf
    #and to add more locations just use ; in between each location
    
    regfile="/ntfs/Windows/System32/config/SOFTWARE"
    key="\Microsoft\Windows\CurrentVersion\DevicePath"
    devpath="%SystemRoot%\DRV;%SystemRoot%\inf;";
    reged -e "$regfile" &>/dev/null <<EOFREG
    ed $key
    $devpath
    q
    y
    EOFREG
    echo -e "\b\b\b\b\b\b\b\b\b\b\b${ceol}Done"; # this just removes "In Progress and replaces it with done :-)"
    

    What can I do to get my new images to detect the drivers, and automatically install them correctly?



  • This worked! Thanks!

    I’m disappointed Microsoft’s method doesn’t work anymore, it was super helpful when we were testing Windows 10 at my previous site…



  • @george1421 OK, I’m re-capturing my image, and then I’ll deploy it. I added the commands for PNPUTIL before turning on the Fog Service, as I know it took quite a while to run after I logged in. I’ll report back once I know whether or not this works.


  • Moderator

    That’s interesting, I would have though 1607 still worked. If you look at this post: https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed/4 You will see that 1703 no longer works with the unattend.xml settings so you need to add the following to the setupcomplete.cmd file.

    pnputil.exe /add-driver "C:\Drivers\*.inf" /subdirs /install
    pnputil.exe /add-driver "C:\Drivers\*.inf" /subdirs /install
    

    Calling the pnputil command twice should be sufficient to find all of the hardware. I don’t know why MS moved away from the unattend.xml file pointing to the drivers. I’m sure there was a good reason.



361
Online

5.7k
Users

13.0k
Topics

122.0k
Posts