[python-win32] How to get access to SetupCopyOEMInf() through python-win32, or maybe use PnPUtil?

Tim Roberts timr at probo.com
Wed Apr 9 19:04:42 CEST 2014


Ron Jackson wrote:
> I would like to write a python program to install a driver inf file in
> Windows. The information I have seen suggests that this would best be
> done using SetupCopyOEMInf().
>
> Is SetupCopyOEMInf() accessible through python-win32?
>
> It looks like the PnPUtil command might provide an alternative way to
> install the inf file.
> <http://msdn.microsoft.com/en-us/library/ff550423%28v=vs.85%29.aspx>
>
> The inf file I want to install is for a USB Communications Device
> Class gadget, and with the inf file installed it properly enumerates
> as a communications port.
>
> Has anyone installed an inf file in Windows through a python program?

There's more to it than that.  What you want to do is have your driver
package installed to the "driver store".  That way, Device Manager can
find the package automatically when the device appears.

It is possible to use "pnputil -i -a xxx.inf" to do that, and you should
try that on a virgin system to see if it works for you, but in most
cases it's better to use DPInst.  That is is a tool that ships in the
WDK that is designed for pre-installing driver packages.  You put
DPInst.exe in the same directory as the CAT, INF, and SYS files, then
run "DPInst /lm".  You can use a short XML directive file to customize
its behavior.

REMEMBER that you need different drivers on 32-bit and 64-bit systems. 
It's possible to make a single driver package that includes both, but
many vendors supply a different package for each, because Microsoft is
preferring that.  If you do with DPInst, you need to use the matching
bittedness for it as well.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20140409/b24f865d/attachment.html>


More information about the python-win32 mailing list