none
How to install the driver in silent?

    Question

  • Hi All!

    I am developing a project to install a USB device driver. Now I have a problem. The .sys file needed had been copied into system32\drivers. And the other .dll files needed by .sys had been copied to system32\ too. The .inf file was copied to inf\. The appropriate registry key had been created also. But when the device was plugged in, system say it can't find the .sys file and .dll file. I must find it by myself.

    I hope I can install the driver in silent. That means when the device plugged in, all will work well. No operation needs to do. How to fix my problem?

    I hope someone could be kind to help me. Thank you!

    Best regards!

    whiteclouds

    Saturday, March 31, 2012 10:16 AM

Answers

  • The problem is that you copy the files manually to their target location *AND* your INF contains CopyFiles sections which tell the system to copy files at PnP install time. But the files aren't in the expected location. Either remove CopyFiles statements, or install the driver in the recommended way (as described in WDK documentation).

    -- pa

    Saturday, March 31, 2012 11:58 AM

All replies

  • First run ChkInf on the INF file, it sounds like you have some errors in the code.  Fix all the errors and warning generated.  Once you have done that try the install cleanly again (i.e. use system restore to remove the install of the driver).  If it does not work use http://msdn.microsoft.com/en-us/library/windows/hardware/ff550887(v=vs.85).aspx to see what is going on with the install.  If you cannot figure it out, then post the inf and the appropriate pieces of the log file to this forum.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Saturday, March 31, 2012 11:10 AM
  • How are you staging/installing the driver? Also what OS are you on?

    For Win7 Driver Package needs to be staged in the DriverStore first. When you plug in your device it will automatically search and select the driver from the staged drivers in DriverStore. Read this for staging the driver: http://technet.microsoft.com/en-us/library/cc772036.aspx

    If you are doing it this way and driver is still not being selected look up for setupapi.dev.log in %windir%\inf\ and look for the section for your devices HW ID (it will probably the last section if you didn't plug any other device after that) and look for errors or paste the section here.


    This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.


    Saturday, March 31, 2012 11:21 AM
  • Glad to see your answer!

    I had check the method. But I can't do it because I haven't the source code of .sys file. By the way, all my work is to install a driver developed by others and a .dll developed by myself. This is a part of a big system. Now I can only list the content of .inf file as following:

    ; ft1k.inf 
    ; 
    ; Installation inf for the Feitian Software 'ePass1000'
    ;
    ; Copyright (c) 2010 Feitian Technologies CO., Ltd.
    ; 
    ;
    
    [Version]
    Signature="$WINDOWS NT$"
    Class=SmartCardReader
    ClassGuid={50dd5230-ba8a-11d1-bf5d-0000f805f530}
    Provider=%OEM%
    DriverVer=01/19/2010,2.5.10.119
    CatalogFile=usbtoken.cat
    
    [DestinationDirs]
    DefaultDestDir = 12
    CoInstaller_CopyFiles = 11 ; System Dir( system32 on NT )
    
    [Manufacturer]
    %StdMfg%=Standard,NTamd64
    
    [Standard]
    ; DisplayName       		Section           DeviceId
    ; -----------       		-------           --------
    %TokenDevice.DeviceDesc%=Token_Device, USB\VID_096e&PID_0002
    %ReaderDevice.DeviceDesc%=Reader_Device,ft1kenum\ft1kifd
    
    [Standard.NTamd64]
    ; DisplayName       		Section           DeviceId
    ; -----------       		-------           --------
    %TokenDevice.DeviceDesc%=Token_Device, USB\VID_096e&PID_0002
    %ReaderDevice.DeviceDesc%=Reader_Device,ft1kenum\ft1kifd
    
    [Token_Device.NT]
    CopyFiles=Token_Device.NT.Copy
    
    [Token_Device.NT.Copy]
    eps1k.sys
    
    
    ; add by wangshuai
    [Token_Device.NT.HW]
    AddReg=Token_Device.NT.HW.AddReg
    
    [Token_Device.NT.HW.AddReg]
    HKR,,DeviceCharacteristics,0x10001,0x0100  						; Use 
    
    same security checks on relative opens
    HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGWGX;;;WD)(A;;GRGWGX;;;RC)"  	; Allow 
    
    generic-all access to Built-in administrators and Local system 
    ;HKR,,Security,,"D:PA;;GA;;;SY)(A;;GRGWGX;;;WD)(A;;GRGWGX;;;RC)"
    ;end
    
    ;-------------- Service installation
    
    [Token_Device.NT.Services]
    AddService = token1k, %SPSVCINST_ASSOCSERVICE%, token_Service_Inst
    
    [token_Service_Inst]
    DisplayName    = %token.DISPNAME%
    Description    = %token_SVCDESC%
    ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
    StartType      = 3               ; SERVICE_DEMAND_START 
    ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
    ServiceBinary  = %12%\eps1k.sys
    LoadOrderGroup = Extended Base
    
    ;-------------- Reader Device Install
    ; x86
    [Reader_device.NTx86]
    CopyFiles=Reader_device_Files
    
    [Reader_Device.NTx86.Services]
    AddService=Reader_1000,0x00000002,Reader_Device_AddService
    
    ; x64
    [Reader_device.NTamd64]
    CopyFiles=Reader_device_Files
    
    [Reader_Device.NTamd64.Services]
    AddService=Reader_1000,0x00000002,Reader_Device_AddService
    
    [Reader_Device_Files]
    usbic1k.SYS
    
    [Reader_Device_AddService]
    DisplayName    = %READER_DISPNAME%
    Description    = %READER_SVCDESC%
    ServiceType    = 1 ; SERVICE_KERNEL_DRIVER
    StartType      = 3 ; SERVICE_DEMAND_START
    ErrorControl   = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary  = %12%\usbic1k.sys
    LoadOrderGroup = Extended Base
    
    
    
    ;-------------- Coinstaller installation
    
    [Token_Device.NT.CoInstallers]
    AddReg=CoInstaller_AddReg
    CopyFiles=CoInstaller_CopyFiles
    
    
    [CoInstaller_CopyFiles]
    ft1kco.dll
    
    [CoInstaller_AddReg]
    HKR,,CoInstallers32,0x00010000,"ft1kco.dll,TokenCoInstaller"
    
    HKR,,DeviceCharacteristics,0x10001,0x0100         							
    
    									; Use same security 
    
    checks on relative opens
    HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGWGX;;;WD)(A;;GRGWGX;;;RC)"  ; Allow 
    
    generic-all access to Built-in administrators and Local system 
    ;HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GRGWGX;;;WD)(A;;GRGWGX;;;RC)"
    
    
    [SourceDisksNames]
    1 = %DiskId1%,,,""
    
    [SourceDisksFiles]
    eps1k.sys  = 1,,
    usbic1k.sys = 1,,
    ft1kco.dll = 1,,
    
    [Strings]
    SPSVCINST_ASSOCSERVICE= 0x00000002
    OEM = "OEM"
    StdMfg = "(Standard system devices)"
    DiskId1 = "SmartcardReader Installation Disk #1"
    TokenDevice.DeviceDesc = "USB Token 1000"
    token.DISPNAME = "usb driver for epass1k"
    token_SVCDESC = "usb token Device Driver 1000"
    ReaderDevice.DeviceDesc="SmartCard Reader Driver 1000"
    Reader_Device_DISPNAME 	 = "SmartCard Reader 1000"
    Reader_Device_SVCDESC 	 = "SmartCard Reader Driver 1000"
    READER_DISPNAME="USB SmartCard Reader Device 1000 "
    READER_SVCDESC="SmartCard Reader Device Driver 1000"

    And the result of ChkInf for .inf file is OK.
    • Edited by whiteclouds Saturday, March 31, 2012 11:39 AM
    Saturday, March 31, 2012 11:30 AM
  • I am just copy the files to system32 and system32\drivers. My OS is windows XP. Because I haven't the source code of the driver, I can't find the .log file as you told me. I hope you could be kind to help me in advance. Thank you!
    Saturday, March 31, 2012 11:37 AM
  • You are going to need to turn on setupAPI logging, and find out what is going on.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Saturday, March 31, 2012 11:41 AM
  • For XP i believe it's located in %windir% instead of *windir%\inf. Use this KB to enable Verbose logging:http://support.microsoft.com/kb/906485


    This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Saturday, March 31, 2012 11:52 AM
  • The problem is that you copy the files manually to their target location *AND* your INF contains CopyFiles sections which tell the system to copy files at PnP install time. But the files aren't in the expected location. Either remove CopyFiles statements, or install the driver in the recommended way (as described in WDK documentation).

    -- pa

    Saturday, March 31, 2012 11:58 AM