Registering COM python based components when not admin

tooper googlenews at
Wed Jan 18 10:46:29 EST 2006


I'm failing to register a python based COM component without having
admin rights...

Using the usual hello world COM server that exist in many
books/tutorial, and works perfecty when tested as admin, I first faced
problems to write in registry as normal user.

Some inspection of win32com.server.register shows a default argument I
missed in the documentation "base=win32con.HKEY_CLASSES_ROOT" for most
calls to set things in registry.

Forcing it to HKEY_CURRENT_USER seems to help for most of the initial
complaining _set_subkeys (and I've checked with regedit that
declaration in registry was effectively started), but a little after I
fail on the following :
  File "C:\...\", line 269, in RegisterServer
    regCat.RegisterClassImplCategories(clsid, catids)
pywintypes.com_error: (-2147024891, 'Acc\xe8s refus\xe9.', None, None)

Unfortunately for me, regCat is a PyICatRegister object returned by
_cat_registrar, coming from a call to pythoncom.CoCreateInstance and
there's no source code I've found for pythoncom (looks it's a compiled
DLL). I tried to add base=win32con.HKEY_CURRENT_USER to
CoCreateInstance call but it complains there are no names args.

Any chance pythoncom is bluntly trying to write in HKEY_CLASSES_ROOT
tree just like register does ?
Any ideas or known workaround ?

Thanks in advance !

More information about the Python-list mailing list