Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

Jonathan Hartley tartley at tartley.com
Tue Dec 29 09:24:09 EST 2009


On Dec 27, 1:51 pm, pyt... at bdurham.com wrote:
> Hi Martin,
>
> > You'll need to include Microsoft.VC90.CRT.manifest and msvcr90.dll.
>
> Thank you for your answers. From my research and testing on this topic:
>
> 1. Can I safely place these 2 files in the same folder as my Py2exe
> generated EXE file or do I need to place the MSVCR90.DLL file in a
> specially named sub-folder?
>
> 2. Do I need to rename the Microsoft.VC90.CRT.manifest file to
> myapp.exe.manifest or can I leave it named as is?
>
> 3. Do I need to customize the contents of the
> Microsoft.VC90.CRT.manifest file for my EXE?
>
> I've been experimenting with different answers to the above questions
> and multiple approaches seems to work. I suspect this is because all the
> workstations I have access to for testing already have the full set of
> MSVC*90.DLL's installed - and not because my multiple tests really work.
>
> Thanks so much for your help!
>
> Malcolm


I just created a VM containing a bare-bones install of Windows XP,
precisely so that I can reproduce the errors my users see when
MSVCR90.DLL is not installed.

It sounds like the wisest course of action is for me to use
vcredist_x86.exe to install the required MSVC runtime on the user's
machine (as opposed to trying to distribute MSVCR90.DLL with my
application.) I can be sure that I have rights to distribute this, and
I don't have to understand side-by-side DLL installation, and I'm
delegating any tricky decisions to Microsoft, who are presumably best
qualified to judge things like: what to do if other versions of the
DLLs are already installed; how to register them to be shared between
multiple applications; whether to update them if Windows Update
decrees it, etc)

I'm going to try to run vcredist_x86.exe automatically (as opposed to
asking my users to download and run it manually). I don't currently
have any installer, so I'm going to run vcredist_x86.exe on my
application start-up. Some logic like this seems to do this trick:

    if platform.system() == 'Windows':
        command = [path.join('lib', 'vcredist_x86.exe'), '/q']
        retcode = subprocess.call(command)
        if retcode != 0:
            sys.stderr.write(
                'Return value %d from vcredist_x86.exe\n' %
(retcode,))

This seems to work. My py2exe program will now run out of the box on a
bare-bones Windows XP install. (note: running 'vcredist_x86.exe /qu'
will uninstall the DLLs again)

However, this takes a few seconds to run. Is there a sensible way for
me to only run this if the required DLL is not already installed? How
should I be detecting that?

Also: Will this work on 64 bit machines? Or do I not need to worry
about that?



More information about the Python-list mailing list