Question

When using py2exe to distribute Python applications with wxPython, some MSVC DLLs are usually needed to make the .exe work on freshly installed machines. In particular, the two most common DLLs are msvcp71.dll and msvcr71.dll

The former can be included in the .exe using this tip. However, the latter is just placed in the dist dir by py2exe and not into the executable, even if I specifically ask to include it.

Any idea how to cause py2exe to include both inside the .exe ?

Was it helpful?

Solution

Wouldn't it fail to launch, then? You want msvcr71.dll in the same directory as the exe, so that the library loader will be able to find and link it into the application's memory map.

It's needed for basic operation, so you can't just let py2exe unpack it with the rest of the DLLs.

OTHER TIPS

py2exe can't do this. You can wrap py2exe (there is an example on the wiki showing how to do that with NSIS); you could build your own wrapper if using NSIS or InnoSetup wasn't an option.

Alternatively, if you're positive that your users will have a compatible copy of msvcr71.dll installed (IIRC Vista or XP SP2 users), then you could get away without including it. More usefully, perhaps, if you use Python 2.3 (or older), then Python links against msvcr.dll rather than msvcr71.dll, and any Windows user will have that installed, so you can just not worry about it.

Yes, py2exe can do this. View this link.And if you are using python2.7, replace "msvcr71" to "msvcp90".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top