Trent Mick <[EMAIL PROTECTED]> writes: > [Thomas Heller wrote] >> py2exe also does something like this in the copy of pythonXY.dll that it >> creates, to avoid the resulting exe pulling in sys.path entries from the >> registry. > > Do you have a quick pointer to the code that does this? I wasn't easily > able to automate doing this with COM code last time I tried.
Python\lib\site-packages\py2exe\build_exe.py, function patch_python_dll_winver(). The py2exe_util extension has exports add_resource, which wraps BeginUpdateResource, UpdateResource, and EndUpdateResource, but they are also wrapped in pywin32 somewhere. Stringtables are a little bit more difficult that other resources, but see py2exe\resources\StringTables.py. The most important thing to remember is that these functions may silently fail if the image file to modify is readonly. Or something like that. Thomas -- http://mail.python.org/mailman/listinfo/python-list