[python-win32] check if comserver is registered, no -> install it?
Tim Roberts
timr at probo.com
Tue Nov 13 19:05:28 CET 2012
Steffen Frömer wrote:
> i have to check, if a comserver-dll is registered in my system.
>
> comserver is registered via command "regsvr32.exe /i myComServer.dll"
> My System is Windows 7 64bit or Windows Server 2008 R2 64 bit.
>
> Is there a way to check this with python and if the check fails, can i
> register this?
> How can i do this?
There is no danger in redoing a registration that has already been
done. All it does is add some registry keys. Might as well just do it
every time. Add "/s" if you don't want to see the dialog box.
Alternatively, assuming you are running a 64-bit Python, you can just
call the registration entry point directly:
import ctypes
dll = ctypes.OleDLL('myComServer.dll')
dll.DllRegisterServer()
That's exactly what Regsvr32 does. It is not a highly sophisticated
application.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list