Here are some of my findings regarding deploying wxPython applications
with py2exe on Windows >XP running Python 2.6.2.
= A little introduction =
Microsoft.VC90.CRT assembly includes three dll files: msvcm90.dll,
msvcp90.dll, msvcr90.dll.
Assembly's manifest file includes assembly identification data and
points to the files included into assembly.
In case of Microsoft.VC90.CRT, assembly's manifest file points to the
msvcm90.dll, msvcp90.dll and msvcr90.dll files.
Every exe/dll which dynamically links against some assembly has to
have its own manifest which references that assembly.
In most cases exe/dll manifest is included as a text resource in XML
format.
To find a manifest resource in some exe/dll file, you can just open
that file in any text editor and search for "</assembly>" string (e.g.
look into Python26\Lib\site-packages\wx-2.8-msw-unicode\wx\_core_.pyd
or into Python26\python.exe)
When exe file with manifest is executed, Windows searches for the
referenced assemblies' dlls in executed file's directory and in WINDOWS
\WinSxS.
Python 2.6.2 for win32 is compiled against the Microsoft.VC90.CRT
assembly version="9.0.21022.8".
= Python installation =
When Python 2.6.2 is getting installed "for all users", CRT assembly
is only copied into WINDOWS\WinSxS. No CRT assembly's manifest or dlls
are copied into Python's folder.
When Python 2.6.2 is getting installed "just for me", no CRT assembly
is copied into WINDOWS\WinSxS. CRT assembly's manifest and msvcr90.dll
are copied into Python's folder. Files msvcm90.dll, msvcp90.dll are
not copied there.
Perhaps, the later is an error. All assembly files, pointed by the
Microsoft.VC90.CRT manifest should be included into installation.
The Microsoft.VC90.CRT assembly manifest which is installed into
WINDOWS\WinSxS is different from the assembly manifest installed into
Python's folder. To deploy wxWidgets programs we need
Microsoft.VC90.CRT manifest which is installed into Python's folder.
We also need all msvcm90.dll, msvcp90.dll and msvcr90.dll files.
One of the ways to get all needed Microsoft.VC90.CRT assembly files is
to:
* install Python 2.6.2 with "just for me" option;
* copy Python26\Microsoft.VC90.CRT.manifest to a temporary location;
* uninstall Python 2.6.2 and delete Python26 folder if it was left by
the uninstaller;
* install Python 2.6.2 with "for all users" option;
* copy all files from the WINDOWS\WinSxS
\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375
folder into Python26 folder;
* copy Microsoft.VC90.CRT.manifest file from your temporary location
into Python26 folder.
Now you can install py2exe and wxPython and whatever else your project
requires :)
= Compiling wxPython program with py2exe =
When wxPython program is compiled with py2exe using "bundle_files": 3,
you do not need to add any manifest into your exe, as all required
manifests are included into other dlls (ie pids). Thus, Windows can
find it, and you just need to make sure that Microsoft.VC90.CRT
assembly is installed either into deployed wxPython program on into
WINDOWS\WinSxS.
When wxPython program is compiled with py2exe using "bundle_files": 1
or 2, the manifest has to be included into deployed wxPython program
exe file. The manifest which worked for me with python-2.6.2,
py2exe-0.6.9.win32-py2.6 and wxPython2.8-win32-unicode-2.8.10.1-py26
on Windows XP and Vista 32 and 64 bit, is following:
manifest = '''
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
version="0.6.8.0"
processorArchitecture="x86"
name="MyCare Card Browser"
type="win32"
/>
<description>MyCare Card Browser Program</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.VC90.CRT"
version="9.0.21022.8"
processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"
/>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
'''
Here again, make sure that Microsoft.VC90.CRT assembly is installed
either into compiled wxPython program directory on into WINDOWS
\WinSxS.
Perhaps, in future more dlls will become parts of some assemblies,
therefore, I think, they should be handled by py2exe automatically.
There also should be a standard "open source" way to install
assemblies into WINDOWS\WinSxS (at least I could not find one,
however, one interesting article to take a look can be found here
http://n2.nabble.com/Tutorial:-How-to-install-files-into-WinSxS-td841...)
ps Special thanks to Andrea Gavana, GUI2Exe is a great idea. I hope
this project will survive and prosper ;)
Victor
On Jun 9, 2:20 pm, "Werner F. Bruhin" <wbru...@gmail.com> wrote:
> Bill,
> Bill Lewis Jr wrote:
> > Werner it does not generate anything at all. All it says is Can't
> > find MSVCP90.dll and the dist directory is empty. It does not mention
> > where it is looking for it.
> Then I would guess that you don't have a copy in Python 2.6 folder or
> your sxs folder which contains it is not found.
> In my py2.6 on Vista folder I have, if IIRC I copied them to that folder.
> msvcm90.dll
> msvcp90.dll
> msvcr90.dll
> no ms.vc90 manifest
> I also have two copies in "W:\Windows\winsxs" v 21022 and v 30729.
> In my py2.6 on Windows 7 folder I have, installed with the option "for
> me only":
> msvcr90.dll
> plus the ms.vc90 manifest
> Here again I also have two copies in "W:\Windows\winsxs" v 21022 and v 30729
> Werner