Programmatic driver install via .inf causing reboot
Asked Answered
M

1

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?

Mesoblast answered 14/10, 2013 at 11:56 Comment(0)
D
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

Derina answered 14/10, 2013 at 14:32 Comment(10)
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...Mesoblast
@Mesoblast 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).Derina
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.Mesoblast
@Mesoblast 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).Derina
@Mesoblast Also, here are some other methods for installing drivers Driver Install Methods - http://forum.installsite.net/index.php?showtopic=15898. Another good link for inf is this Gosh MSFN - http://gosh.msfn.org/infs.htmDerina
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.Mesoblast
@Mesoblast Let us know if you figure anything out :)Derina
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.Mesoblast
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...Mesoblast
?what syntax should be used to dynamic uninstall of the same driverOctosyllabic

© 2022 - 2024 — McMap. All rights reserved.