> -----Original Message----- > From: MACKEITH Andrew [mailto:[EMAIL PROTECTED] > Sent: Saturday, 19 January 2008 1:00 AM > To: Mark Hammond; Python-Win32 List > Subject: RE: [python-win32] COM registration/unregistration and > elevation onVista > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Mark Hammond > > Sent: Thursday, January 17, 2008 11:10 PM > > To: 'Python-Win32 List' > > Subject: [python-win32] COM registration/unregistration and > > elevation onVista > > > > On Vista, it's necessary to register python COM objects from > > an "elevated" > > process. In practice, this means I tend to keep a > > command-prompt open started with "run as administrator", do > > registration and unregistration there, then switch back to > > the normal command-prompt to do testing etc. I finally got > > annoyed at this, and came up with a patch that catches this > > error, then retries the command after prompting for elevation > > (the infamous Vista "Allow" dialog). > > > > However, it's not perfect; > > * a new process is created to perform the actual > > registration, and the output from this process is lost. The > > normal ways of getting child process will not work, as the > > child must be executed via ShellExecuteEx for the elevation > > to happen. We can get the exit code of the process, but no output. > > * The elevation prompt simply says "python.exe" wants > > big-bad-scary access to your computer. AFAIK, there is no > > way to have windows use a different string (ie, to indicate a > > com object is being registered) > > * It might be too magic - should this just be left as the > > responsibility of the packager? Will it interfere with > > "frozen" servers? > > > > As a result, I'd like some feedback on my approach - both the > > specific implementation and the general idea, or anything > > else you can think of. > > I've attached the patch. > > > > Does this mean that a user needs administrator access to use Python COM > on Vista, or is this only for registering a Python COM object for use > as a COM server?
The latter - only when registering the object. Once registered, it can be used by normal users. Mark _______________________________________________ python-win32 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-win32
