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 ?
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.
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".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With