467,894 Members | 1,554 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

Registering COM python based components when not admin

Hello,

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:\...\register.py", 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 !

Jan 18 '06 #1
  • viewed: 1943
Share:
2 Replies
To register the com server for only the current user,
your base key should be
HKEY_CURRENT_USER\SOFTWARE\Classes
instead of just HKCU.

However, I don't know if this will solve your problem
or not. The ICatRegister interface is supplied by the
system, so nobody but MS has the source code to the
RegisterClassImplCategories method. I don't see
anything in the SDK docs indicating how it determines
whether it should write to HKCU or HKLM.

hth
Roger
"tooper" <go********@tooper.org> wrote in message news:11*********************@g44g2000cwa.googlegro ups.com...
Hello,

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:\...\register.py", 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 !


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jan 19 '06 #2
Thanks for the hint !

Jan 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by David | last post: by
36 posts views Thread by Andrea Griffini | last post: by
9 posts views Thread by corey.coughlin | last post: by
10 posts views Thread by James Stroud | last post: by
122 posts views Thread by Edward Diener No Spam | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.