py2exe, Py26, wxPython and dll

Hi,

Thomas Heller has released py2exe for Python (thanks). It works fine. However, I am
a little bit confused, and in order to distribute a somehow complete standalone
application, I would like to distribute the “correct” dll’s too.

The problem is on the msvcr*.dll file side. Python 2.6 is compiled against VS9, that means
msvcr90.dll has to be distributed. Basically the same story as msvcr71.dll for Python 2.5.

But, what about the msvcr71.dll for Python 2.6/wxPython? This file is installed by wxPython
(see wxPython-dev list). Is it required by wxPython?

Jean-Michel Fauth, Switzerland

Jean-Michel Fauth wrote:

Hi,

Thomas Heller has released py2exe for Python (thanks). It works fine. However, I am
a little bit confused, and in order to distribute a somehow complete standalone
application, I would like to distribute the "correct" dll's too.

The problem is on the msvcr*.dll file side. Python 2.6 is compiled against VS9, that means
msvcr90.dll has to be distributed. Basically the same story as msvcr71.dll for Python 2.5.

But, what about the msvcr71.dll for Python 2.6/wxPython? This file is installed by wxPython
(see wxPython-dev list). Is it required by wxPython?

IMO the whole "side-by-side assembly" thing used with the new version of the runtime DLLs is a royal pain in unmentionable places. You can't just copy the DLLs along side your executables anymore, they have to be installed as an assembly and your executables need to have a manifest which states exactly which versions of the assemblies it will be using.

I haven't tried anything with the new py2exe and py 2.6 yet, but my guess is that you'll need to do something like embed Microsoft's redistributables installer in your installer and invoke it as part of your installation process if that SxS assembly is not already installed on the target system.

If somebody has already done the grunt work on this, a How-To for the wiki would be real helpful for everybody else.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Jean-Michel Fauth wrote:

Thomas Heller has released py2exe for Python (thanks). It works fine.
However, I am
a little bit confused, and in order to distribute a somehow complete
standalone
application, I would like to distribute the "correct" dll's too.

The problem is on the msvcr*.dll file side. Python 2.6 is compiled
against VS9, that means
msvcr90.dll has to be distributed. Basically the same story as
msvcr71.dll for Python 2.5.

But, what about the msvcr71.dll for Python 2.6/wxPython? This file is
installed by wxPython
(see wxPython-dev list). Is it required by wxPython?

IMO the whole "side-by-side assembly" thing used with the new version
of the runtime DLLs is a royal pain in unmentionable places. You
can't just copy the DLLs along side your executables anymore, they
have to be installed as an assembly and your executables need to have
a manifest which states exactly which versions of the assemblies it
will be using.

Exactly. I have an entire speech about the utter idiocy of the SxS
concept, which I will reproduce here some time when things get too quiet.

I haven't tried anything with the new py2exe and py 2.6 yet, but my
guess is that you'll need to do something like embed Microsoft's
redistributables installer in your installer and invoke it as part of
your installation process if that SxS assembly is not already
installed on the target system.

Actually, there is a way to install the run-time DLLs in a local
subdirectory. You can create a subfolder called "Microsoft.VC90.CRT"
and copy the DLLs there. You still need a manifest, but you don't have
to go through the whole redistributable installer.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Tim Roberts wrote:

Robin Dunn wrote:
  

Jean-Michel Fauth wrote:
    

Thomas Heller has released py2exe for Python (thanks). It works fine.
However, I am
a little bit confused, and in order to distribute a somehow complete
standalone
application, I would like to distribute the "correct" dll's too.

The problem is on the msvcr*.dll file side. Python 2.6 is compiled
against VS9, that means
msvcr90.dll has to be distributed. Basically the same story as
msvcr71.dll for Python 2.5.

But, what about the msvcr71.dll for Python 2.6/wxPython? This file is
installed by wxPython
(see wxPython-dev list). Is it required by wxPython?
      

IMO the whole "side-by-side assembly" thing used with the new version
of the runtime DLLs is a royal pain in unmentionable places. You
can't just copy the DLLs along side your executables anymore, they
have to be installed as an assembly and your executables need to have
a manifest which states exactly which versions of the assemblies it
will be using.
    
Exactly. I have an entire speech about the utter idiocy of the SxS
concept, which I will reproduce here some time when things get too quiet.

I haven't tried anything with the new py2exe and py 2.6 yet, but my
guess is that you'll need to do something like embed Microsoft's
redistributables installer in your installer and invoke it as part of
your installation process if that SxS assembly is not already
installed on the target system.
    
Actually, there is a way to install the run-time DLLs in a local
subdirectory. You can create a subfolder called "Microsoft.VC90.CRT"
and copy the DLLs there. You still need a manifest, but you don't have
to go through the whole redistributable installer.

Do these DLLs require some kind of purchased license for distribution. This thread seems to indicate that because Python 2.4/2.5 itself distributes the DLL, anyone creating something with Python is also licensed to redistribute it:

http://groups.google.com/group/comp.lang.python/browse_thread/thread/f8df5ed32b324a3f/

I am assuming that this would also apply to 2.6, but I'm not a lawyer and don't want to be.

Mike

Robin, Tim, …

Thanks for your replies. Indeed, from what I can read on misc. lists (Python-dev or Python bugs report, …eg http://bugs.python.org/issue4120 the situation is quite complex and goes beyond my knowledge.

So, wait and see

Jean-Michel Fauth, Switzerland

···

2008/11/18 Robin Dunn robin@alldunn.com

Jean-Michel Fauth wrote:

Hi,

Thomas Heller has released py2exe for Python (thanks). It works fine. However, I am

a little bit confused, and in order to distribute a somehow complete standalone

application, I would like to distribute the “correct” dll’s too.

The problem is on the msvcr*.dll file side. Python 2.6 is compiled against VS9, that means

msvcr90.dll has to be distributed. Basically the same story as msvcr71.dll for Python 2.5.

But, what about the msvcr71.dll for Python 2.6/wxPython? This file is installed by wxPython

(see wxPython-dev list). Is it required by wxPython?

IMO the whole “side-by-side assembly” thing used with the new version of the runtime DLLs is a royal pain in unmentionable places. You can’t just copy the DLLs along side your executables anymore, they have to be installed as an assembly and your executables need to have a manifest which states exactly which versions of the assemblies it will be using.

I haven’t tried anything with the new py2exe and py 2.6 yet, but my guess is that you’ll need to do something like embed Microsoft’s redistributables installer in your installer and invoke it as part of your installation process if that SxS assembly is not already installed on the target system.

If somebody has already done the grunt work on this, a How-To for the wiki would be real helpful for everybody else.

Mike wrote:

Tim Roberts wrote:

Actually, there is a way to install the run-time DLLs in a local
subdirectory. You can create a subfolder called "Microsoft.VC90.CRT"
and copy the DLLs there. You still need a manifest, but you don't have
to go through the whole redistributable installer.

Do these DLLs require some kind of purchased license for distribution.
This thread seems to indicate that because Python 2.4/2.5 itself
distributes the DLL, anyone creating something with Python is also
licensed to redistribute it:

Good question.

When you install Visual Studio 200X, there is a file called "redist.txt"
that spells this out in excruciating detail. As long as the package was
built by someone who has a VS license, the runtime library DLLs can be
freely redistributed. You can distribute a standalone installer, a
Microsoft installer "merge module", or the raw directories with the
DLLs. All three are provided in Visual Studio.

One very interesting side note is that they specifically DENY you the
right to redistribute the debug DLLs.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

[CC to py2exe-users]

I haven't tried anything with the new py2exe and py 2.6 yet, but my
guess is that you'll need to do something like embed Microsoft's
redistributables installer in your installer and invoke it as part of
your installation process if that SxS assembly is not already
installed on the target system.

I have not seriously used Python 2.6 with py2exe, also I have no experience
with this new manifest stuff, but a little experiment showed that this approach
seems to work for simple cases (I tested only on XP machines, not Vista!):

I deinstalled python 2.6 (since I had installed it 'for all users') and
installed it again 'for me only'. This installation copied the msvcr90.dll
and Microsoft.VC90.CRT.manifest files into the c:\python26 folder.

Then I ran py2exe over a very simple script ('print "Hi"') which created
an executable. This executable worked fine on a machine where msvcr90.dll
was installed in Windows\SxS (or how it's called), but did NOT run on another
machine where msvcr90.dll is not installed in Windows\SxS.

Then I copied the msvcr90.dll and Microsoft.VC90.CRT.manifest files into the dist
folder where py2exe had created my executable. Now the exe works on both machines.

When I tried to do the same for a simple wxPython script py2exe crashed because
it tried to load msvcp90.dll (IIRC), but didn't find it (it seems only to be installed
in the Windows\SxS folder). This may be a bug in py2exe.

Actually, there is a way to install the run-time DLLs in a local
subdirectory. You can create a subfolder called "Microsoft.VC90.CRT"
and copy the DLLs there. You still need a manifest, but you don't have
to go through the whole redistributable installer.

Do these DLLs require some kind of purchased license for distribution.
This thread seems to indicate that because Python 2.4/2.5 itself
distributes the DLL, anyone creating something with Python is also
licensed to redistribute it:

http://groups.google.com/group/comp.lang.python/browse_thread/thread/f8df5ed32b324a3f/

I am assuming that this would also apply to 2.6, but I'm not a lawyer
and don't want to be.

Python 2.6, in the LICENSE.txt file, contains a new paragraph specifying
additional conditions for windows. Hope this clarifies the license issue
(I am not a laywer, blah, blah):

<quote start>
Additional Conditions for this Windows binary build

···

---------------------------------------------------

This program is linked with and uses Microsoft Distributable Code,
copyrighted by Microsoft Corporation. The Microsoft Distributable Code
includes the following files:

msvcr90.dll
msvcp90.dll
msvcm90.dll

If you further distribute programs that include the Microsoft
Distributable Code, you must comply with the restrictions on
distribution specified by Microsoft. In particular, you must require
distributors and external end users to agree to terms that protect the
Microsoft Distributable Code at least as much as Microsoft's own
requirements for the Distributable Code. See Microsoft's documentation
(included in its developer tools and on its website at microsoft.com)
for specific details.

Redistribution of the Windows binary build of the Python interpreter
complies with this agreement, provided that you do not:

- alter any copyright, trademark or patent notice in Microsoft's
Distributable Code;

- use Microsoft’s trademarks in your programs’ names or in a way that
suggests your programs come from or are endorsed by Microsoft;

- distribute Microsoft's Distributable Code to run on a platform other
than Microsoft operating systems, run-time technologies or application
platforms; or

- include Microsoft Distributable Code in malicious, deceptive or
unlawful programs.

These restrictions apply only to the Microsoft Distributable Code as
defined above, not to Python itself or any programs running on the
Python interpreter. The redistribution of the Python interpreter and
libraries is governed by the Python Software License included with this
file, or by other licenses as marked.

<quote end>

--
Thanks,
Thomas