none
Installing driver using INF file from command line on Windows 7 64 bit failing.

    Question

  • Hi All,

        I am trying to install driver using INF file from command line using rundll32.exe. Following is the command which I am using:

        rundll32 setupapi, InsatllHinfSection DefaultInstall 132 <name_of_INF>.inf

        But it is failing consistantly with message boc "Installation Failed". If I right-click on the same INF file and "Install", then driver is installed properly.  If I use this same command on x86 platform then also it works fine.

         After searching I came to know that this is the same command which I need to use to install driver using INF on Windows 64 bit version. Am I doing something wrong? Please help me out in this. Thanks in advance.

    -Satej PrabhuPatkar

    Monday, December 13, 2010 7:57 AM

Answers

  • Greetings,

    I've learned a lot about this particular method.  In short, starting in Vista, DefaultInstall sections will need to be platform specific if the platform is specific :)  DefaultInstalls which fail with "Installation Failed" will succeed if the section is decorated (e.g. DefaultInstall.amd64)

    However, it should be understood, you can't actually install a driver this way.  DefaultInstall is a legacy method which will only (1) copy files and (2) create a service section.  Nothing else (for the most part).  Driver Installation is more complicated than this and indeed, DefaultInstall also has no concept of what a signed driver is and the CAT file will never be properly moved over the the CATDB.  FYI  (See: http://msdn.microsoft.com/en-us/library/ff547356(VS.85).aspx ) and

    Note The INF file of a driver package must not contain an INF DefaultInstall section if the driver package is to be digitally signed. For more information about signing driver packages, see Driver Signing.

    It's better to use SetupDI to install drivers instead of this method.


    Daniel Whitaker WDK Support Team
    Thursday, March 10, 2011 6:50 PM

All replies

  • Given that is a cut & paste, I would suggest you check your spelling. Should it not be InstallHinfSection, instead of InsatllHinfSection? G'ooness, even the spell checker on this browser interface doesn't like the second form, or as you spelled it.

     


    Gary G. Little NanoTelesis Systems, LLC
    Monday, December 13, 2010 2:12 PM
  • is this a pnp driver? if so, you cannot right click install or use rundll32 to install the driver properly

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, December 13, 2010 5:48 PM
    Owner
  • Hi..

    I have the same problem while installing the scanner sample from wdk on windows 7 by the commandline written below..

    rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 "c:\My Files\WDKsamples\scanner.INF"

    When I right-click ->Install this file then driver gets installed and keeps the files to their respective paths.

    Please help me .... Thanks in Advanvce...

    Thursday, March 10, 2011 5:44 AM
  • Hi..

    I have problem while installing the scanner sample from wdk on windows 7 by the commandline written below..

    rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 "c:\My Files\WDKsamples\scanner.INF"

    When I right-click ->Install this file then driver gets installed and keeps the files to their respective paths.

    Please help me .... Thanks in Advanvce...

    (* Driver is compiled as 64 bit and digital signature also...)

    • Merged by markRoddyModerator Thursday, March 10, 2011 5:41 PM Appears to be the exact same question, word for word.
    Thursday, March 10, 2011 6:02 AM
  • Ok, and what exactly is bad about using right-click to kick off an install? It's easy to navigate too, and relatively intuitive as opposed to having to remember path and file name. You need to use a viable executable such as devcon, for which you also get the source, or write your own using the non-pnp example in the WDK. You may or may not need the installation of the WDF co-installer included in the non-pnp source.


    Gary G. Little NanoTelesis Systems, LLC
    Thursday, March 10, 2011 12:16 PM
  • Answered in the OTHER thread that you started. So right click. IT's easier than opening a command line and entering path and file name, AND ... the system is written to install it that way.
    Gary G. Little NanoTelesis Systems, LLC
    Thursday, March 10, 2011 12:18 PM
  • You need to run this elevated.
    Mark Roddy Windows Driver and OS consultant www.hollistech.com
    Thursday, March 10, 2011 2:14 PM
    Moderator
  • Try: rundll32 SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 "c:\My Files\WDKsamples\scanner.INF"

    http://msdn.microsoft.com/en-us/library/aa376957%28v=vs.85%29.aspx

    • Proposed as answer by wangyeqi Tuesday, January 28, 2014 7:20 AM
    Thursday, March 10, 2011 5:54 PM
  • Greetings,

    I've learned a lot about this particular method.  In short, starting in Vista, DefaultInstall sections will need to be platform specific if the platform is specific :)  DefaultInstalls which fail with "Installation Failed" will succeed if the section is decorated (e.g. DefaultInstall.amd64)

    However, it should be understood, you can't actually install a driver this way.  DefaultInstall is a legacy method which will only (1) copy files and (2) create a service section.  Nothing else (for the most part).  Driver Installation is more complicated than this and indeed, DefaultInstall also has no concept of what a signed driver is and the CAT file will never be properly moved over the the CATDB.  FYI  (See: http://msdn.microsoft.com/en-us/library/ff547356(VS.85).aspx ) and

    Note The INF file of a driver package must not contain an INF DefaultInstall section if the driver package is to be digitally signed. For more information about signing driver packages, see Driver Signing.

    It's better to use SetupDI to install drivers instead of this method.


    Daniel Whitaker WDK Support Team
    Thursday, March 10, 2011 6:50 PM
  • Actually this is the documented method for installing specific types of drivers, for example filesystem minifilters. The OP's question was specific to minifilter installation.

     

    See for example: http://msdn.microsoft.com/en-us/library/ff557251(v=vs.85).aspx 

    where the exact method used by the OP is documented as appropriate to this type of driver.

     

    "To execute the DefaultInstall and DefaultInstall.Services sections of your INF file on the command line or by using a batch file installation, type the following command at the command prompt, or create and run a batch file that contains this command:

    RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 path-to-inf\infname.inf"


    Mark Roddy Windows Driver and OS consultant www.hollistech.com
    Thursday, March 10, 2011 7:19 PM
    Moderator
  • As long as driver signing isn't required :)  I've seen this used for a lot of different purposes.  But for Vista and higher, the driver signing component may be critical.  As such DefaultInstall just won't do the job unfortunately.  So hopefully that won't come into play here.
    Daniel Whitaker WDK Support Team
    Thursday, March 10, 2011 8:12 PM
  • markRoddy wrote:
    >
    >Actually this is the documented method for installing specific types of
    >drivers, for example filesystem minifilters. The OP's question was
    >specific to minifilter installation.
     
    Yes. I like to think of the [DefaultInstall] thing as a shortcut for a
    very simple software installer. It doesn't do anything that can't also be
    done by a batch file with "copy" and "sc" commands.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, DDK MVP
    Friday, March 11, 2011 6:50 AM
  • I'm sorry, but perhaps you could explain what you think the installation procedure is for a filesystem minifilter driver on Win7? As far as I know, 'right click inf file' or its equivalents are THE ONLY WAY, and yes your minifilter has to be signed for WIN7 x64. If there is some other mechanism, and if in fact installation as documented in the WDK does not work, perhaps you might want to update the WDK pages I pointed you at.

     

    perhaps the confusion here is that we are not talking about pnp drivers?

     


    Mark Roddy Windows Driver and OS consultant www.hollistech.com
    Friday, March 11, 2011 3:38 PM
    Moderator
  • Thanks Emberstone for clearing the things...

    Actually I m going to install the driver by the proper way and having problem while copying the files to specific paths... ie.. ..\drivers Folder.

    now I detected exac problem and noticed that it's due to Access rights to the 'drivers' folder...

    Thanks all ,  You all guys helped me a lot...

    Friday, March 18, 2011 1:24 PM

       

      I'm getting this same issue but using SetupAPI. I've been wrestling with this issue for a month or two now and it's driving me crazy. I've tried countless variants on the inf-file and the setupapi-calls but am just getting different issues without really moving forward. So this is what I have at the moment.

       

      Files
      myMinifilter.inf
      myMinifilter.sys (signed)
      myMinifilter.pdb
      myMinifilter.cat (signed)


      Installer
      InstallShield 2010 InstallScript installer compiled for 64 bit release.

       

      Target System
      Windows Server 2008  R2 - 64bit ( Updated with all current OS-patches and IE9)

       

      Code Procedure

    1. Attempt to copy files using SETUPAPI.SetupCopyOEMInfA()
      SUCCESS: myMiniFilter.inf copied to oem1.inf in Windows\inf dir, and driver package files to 'C:\Users\ADMINI~1\AppData\Local\Temp\{[CLSID]}' successfully

      WARNING:  {_VERIFY_FILE_SIGNATURE} ( in setupapi.dev.inf) failed with "Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider."

       

    2. SETUPAPI.SetupOpenInfFileA() using returned inf-path from step 1.
      SUCCESS

       
    3. SETUPAPI.SetupOpenFileQueue()
      SUCCESS

       
    4. SETUPAPI.SetupQueueCopySectionA() using section “DefaultInstall” and the %windir%\inf path
      SUCCESS: Looking at the setupapi.app.log it now has a couple of interesting lines:

      Architecture = amd64 (Previously when the path was pointing to my souredir for the installer Architecture was = x86 So not due to IS being 32bit! Now this looks correct).

      Two instances of "!    flq: Missing SourceDisksFiles/SourceDisksNames information from INF." in setupapi.app.log, I've tried messing with the inf-file quite a lot but to no avail, either the syntax is not supported by inf2cat.exe or I get warnings like these.

       
    5. SETUPAPI.SetupCommitFileQueueA() with no callback specified.
      FAILED with error 13 (The data is invalid).

      Looking at setupapi.app.log the following error is posted: "!!!  flq: The file queue callback routine faulted during commit with exception c0000005."

       

    6. SETUPAPI. SetupCloseFileQueue()
      SUCCESS

    So as you can see pretty much the same a above, looks like a premissions issue but I am running the setup as Admin and there are no other issues (services are installed, accouts are validated, etc.) What am I missing?

    Tuesday, January 17, 2012 11:25 AM
  • Just use pnputil to install from command line.

    Usage:
    ------
    pnputil.exe [-f | -i] [ -? | -a | -d | -e ] <INF name>
    Examples:
    pnputil.exe -a a:\usbcam\USBCAM.INF      -> Add package specified by USBCAM.INF
    pnputil.exe -a c:\drivers\*.inf          -> Add all packages in c:\drivers\
    pnputil.exe -i -a a:\usbcam\USBCAM.INF   -> Add and install driver package
    pnputil.exe -e                           -> Enumerate all 3rd party packages
    pnputil.exe -d oem0.inf                  -> Delete package oem0.inf
    pnputil.exe -f -d oem0.inf               -> Force delete package oem0.inf
    pnputil.exe -?                           -> This usage screen

    Saturday, December 07, 2013 3:16 PM