Registering COM python based components when not admin

Roger Upole rupole at hotmail.com
Wed Jan 18 19:30:07 EST 2006


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" <googlenews at tooper.org> wrote in message news:1137599189.199587.87960 at g44g2000cwa.googlegroups.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 =---



More information about the Python-list mailing list