Patches item #1806435, was opened at 2007-10-03 02:17
Message generated for change (Comment added) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551956&aid=1806435&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Out of Date
Priority: 5
Private: No
Submitted By: Robert Langmeier (rlangmeier)
Assigned to: Nobody/Anonymous (nobody)
Summary: registring a win32com server with non admin privilges only
Initial Comment:
I produced this patch to be able to register and use a COM server with insufficient privileges.
A little explanation:
- As a non admin user, you cannot write HKEY_CLASSES_ROOT, but you can register a COM server into HKEY_CURRENT_USER
- HKEY_CLASSES_ROOT is a consolidated view of HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER (see MSDN)
- The client can always read the registry keys in HKEY_CLASSES_ROOT
It would be great if it can be integrated in a future build. Some check has to be done for parts i'm not using. Registring and unregistring "Standard" servers is correct and functionning.
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2010-08-30 10:56
Message:
we can now register either way I believe.
----------------------------------------------------------------------
Comment By: Mark Hammond (mhammond)
Date: 2008-07-04 12:13
Message:
Logged In: YES
user_id=14198
Originator: NO
FWIW, VS 2008 appears to use "regsvr32 /s /i:user dllname.dll" when you
select the "register per user" option in their IDE UI (I can't recall the
exact spelling of the UI option). It's undocumented best I can tell, but I
stumbled across how IronPython checks for this, and it worked!
The code a C++ DLL needs to support this in MSVS is below (from Tamarin):
it makes sense that we do the same to support this functionality?
STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine)
{
HRESULT hr = E_FAIL;
// MSVC will call "regsvr32 /i:user" if "per-user registration" is set
as a
// linker option - so handle that here (its also handle for anyone else
to
// be able to manually install just for themselves.)
static const wchar_t szUserSwitch[] = L"user";
if (pszCmdLine != NULL)
{
if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) ==
0)
{
AtlSetPerUserRegistration(true);
// But ATL still barfs if you try and register a COM category,
so
// just arrange to not do that.
_AtlComModule.m_ppAutoObjMapFirst =
_AtlComModule.m_ppAutoObjMapLast;
}
}
if (bInstall)
{
hr = DllRegisterServer();
...
----------------------------------------------------------------------
Comment By: Mark Hammond (mhammond)
Date: 2008-05-05 21:00
Message:
Logged In: YES
user_id=14198
Originator: NO
Note that _get_classe_hkey() can probably go - just checking if you can
open the key with KEY_ALL_ACCESS should work. Note too that the CVS
version of register.py takes a different approach - it attempts to elevate
and retry. This means we would probably need to add a new cmdline option
to specify which behaviour you desire. Finally, it would be great if you
can send me a "diff" which compares the old and new files (use "diff -u") -
otherwise it is very hard to determine what changes you made.
Thanks
----------------------------------------------------------------------
Comment By: Robert Langmeier (rlangmeier)
Date: 2007-10-12 07:00
Message:
Logged In: YES
user_id=75471
Originator: YES
just corrected a bug in _get_classe_hkey and modified RegisterServer
File Added: register-patch.py
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551956&aid=1806435&group_id=78018
|