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. Thanks! Mark
register_uac.patch
Description: Binary data
_______________________________________________ python-win32 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-win32
