2

I'm trying to install a driver via an inf file using this command:

rundll32.exe setupapi,InstallHinfSection DefaultInstall 128 .\my_driver.inf

According to MSDN (http://msdn.microsoft.com/en-us/library/aa376957%28v=vs.85%29.aspx), by suplying 128 as the parameter, apart from "Set the default path of the installation to the location of the INF. This is the typical setting", the install should (+0) not ask the user for a reboot. However, in my case, it always does.

What am I doing wrong?

CharlesB
  • 86,532
  • 28
  • 194
  • 218
conectionist
  • 2,694
  • 6
  • 28
  • 50

1 Answers1

6

Use advpack.dll instead of setupapi.dll

rundll32.exe advpack.dll,LaunchINFSection inf filename[,section name][,flags][,smart reboot]

The reboot with setupapi.dll seems to be a common problem with the 128 value for SETUPAPI.DLL from what I saw on a web search.

Example

rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 .\my_driver.inf

rundll32.exe advpack.dll,LaunchINFSection .\my_driver.inf,,3,N

These commands should both operate in a similar fashion. They will both invoke DefaultInstall section of the .inf file.

References

Community
  • 1
  • 1
David Ruhmann
  • 11,064
  • 4
  • 37
  • 47
  • Thanks for your answer. The links were useful, too. This indeed solves my reboot problem. However, my install is now unsuccessful if I use this. It just doesn't install the driver... – conectionist Oct 15 '13 at 13:43
  • @conectionist Try the `advpack.dll` command with a `0` or `2` value instead of `3` that way any GUI error messages or stderr messages should display. `3` is quite mode (1) + no grpconv (2). – David Ruhmann Oct 15 '13 at 14:39
  • Tried it. A small window in the top-left corner appears for a split second (probably the one the displays the copying of the files) and then it disappears. I waited a few seconds and then rebooted and nothing. I tried it with both 0 and 2. – conectionist Oct 15 '13 at 14:50
  • @conectionist Are the files copied? Are the files replacing any existing files? From what I read, these commands do not work for updating drivers, only initial installation. Meaning, if the target device has already been loaded with default drivers or another version, then these commands will install the driver files, but not switch the device to these drivers. [(From the Similar Issue link)](http://www.msfn.org/board/topic/104891-how-can-i-install-a-inf-file-from-the-command-line/#entry1032654). – David Ruhmann Oct 15 '13 at 19:04
  • @conectionist Also, here are some other methods for installing drivers [**Driver Install Methods** - http://forum.installsite.net/index.php?showtopic=15898](http://forum.installsite.net/index.php?showtopic=15898). Another good link for inf is this [**Gosh MSFN** - http://gosh.msfn.org/infs.htm](http://gosh.msfn.org/infs.htm) – David Ruhmann Oct 15 '13 at 19:06
  • They are copied and it's an initial install. I think they simply aren't loaded (properly or at all). Thank you for the Install Methods link. Maybe they'll solve the problem. – conectionist Oct 16 '13 at 08:52
  • @conectionist Let us know if you figure anything out **`:)`** – David Ruhmann Oct 17 '13 at 19:38
  • Certainly. But I have to warn you that this will take a few weeks because I've spent enough time on this issue and I have to work on other things so don't expect a reply soon. But if I'm not mistaken, you will be automatically notified via email or you'll at least receive a message in your inbox here, at stackoverflow when I post a reply here. – conectionist Oct 18 '13 at 19:33
  • sorry. no. I had this problem on a project at my workplace, but the project has unexpectedly been cancelled and, consequently, all work regarding that project has ceased. I'm afraid I won't be able to help anyone. Sorry for those of you who were waiting for a reply from me... – conectionist Mar 15 '14 at 15:47
  • ?what syntax should be used to dynamic uninstall of the same driver – ZEE Mar 17 '14 at 20:57