Connecting Tech Pros Worldwide Forums | Help | Site Map

Compiling wxPython app for Windows; Single EXE

Vincent Delporte
Guest
 
Posts: n/a
#1: Aug 13 '06
Hi

I browsed the archives, but since some messages date back a bit, I
wanted to make sure that

- py2exe is still the best tool in town to compile Python scripts to
run on a Windows host that doesn't have Python installed, including
wxWidgets/wxPython

- there's no way to build a single EXE, to make deployment easier (if
multiple files, I need to build an installer with eg. NSIS or
InnoSetup)?

Thank you.

Tim N. van der Leeuw
Guest
 
Posts: n/a
#2: Aug 13 '06

re: Compiling wxPython app for Windows; Single EXE



Vincent Delporte wrote:
Quote:
Hi
>
I browsed the archives, but since some messages date back a bit, I
wanted to make sure that
>
- py2exe is still the best tool in town to compile Python scripts to
run on a Windows host that doesn't have Python installed, including
wxWidgets/wxPython
>
- there's no way to build a single EXE, to make deployment easier (if
multiple files, I need to build an installer with eg. NSIS or
InnoSetup)?
>
Thank you.
Hi,

I have a wxPython app, which I compile into one EXE file. Then there's
just 1 support file needed: a MS DLL (which, once distributed, you will
not need to update).
Oh, and for w9x support there's an extra file, popenw9x.exe (or
something like that) which you can probably forget about if you don't
wish to support that.

Well, OK, that makes 3 files... Icons for windows are extra too, and
any other setup/ini/datafiles you wish to add and that are opened as
'normal' files too.

So what I do then is bundle it up as an self-extracting-archives, using
7-zip, which by default extracts into a sub-directory of the directory
where you copy the SEA-exe.

Voila, simple and easy, no installer required.

Works for me; dunno if it's good enough for your needs as well. (Oh,
and creating the SEA-exe you can probably automate if from the setup.py
but I haven't bothered yet)

Cheers and good luck,

--Tim

Vincent Delporte
Guest
 
Posts: n/a
#3: Aug 13 '06

re: Compiling wxPython app for Windows; Single EXE


On 13 Aug 2006 13:46:14 -0700, "Tim N. van der Leeuw"
<tim.leeuwvander@nl.unisys.comwrote:
Quote:
>I have a wxPython app, which I compile into one EXE file. Then there's
>just 1 support file needed: a MS DLL (which, once distributed, you will
>not need to update).
OK. So you compile the Python app into an EXE using py2exe, and then
use eg. 7Zip to combine all the files into a single EXE, that
1. uncompresses itself in the directory validated by the user
2. when done, runs the Python EXE?
Satya
Guest
 
Posts: n/a
#4: Aug 14 '06

re: Compiling wxPython app for Windows; Single EXE


Vincent Delporte wrote:

<snip>
Quote:
- there's no way to build a single EXE, to make deployment easier (if
multiple files, I need to build an installer with eg. NSIS or
InnoSetup)?
>
I am using InnoSetup. The included example script (I believe in py2exe) is
adequate for simple applications. I just modified a few lines and I had a
neat Windows Installer.

Satya

--
Posted via a free Usenet account from http://www.teranews.com

Larry Bates
Guest
 
Posts: n/a
#5: Aug 14 '06

re: Compiling wxPython app for Windows; Single EXE


Satya wrote:
Quote:
Vincent Delporte wrote:
>
<snip>
Quote:
>- there's no way to build a single EXE, to make deployment easier (if
>multiple files, I need to build an installer with eg. NSIS or
>InnoSetup)?
>>
>
I am using InnoSetup. The included example script (I believe in py2exe) is
adequate for simple applications. I just modified a few lines and I had a
neat Windows Installer.
>
Satya
>
+1 on the Inno Installer solution. I use it a lot and it is both
easy to use and flexible for distributing Python apps on Windows.
While just compressing into self-extracting .exe works for simple
apps, there always seem to be "other" things you want to do. Things
like modifying .ini files, setting up shortcuts and icons on user's
desktop, start list, quickstart list. Registering dlls, starting
services, ... Inno Installer can help you with all these things.
The combination of py2exe and Inno Installer is hard to beat.

-Larry Bates
ajaksu
Guest
 
Posts: n/a
#6: Aug 14 '06

re: Compiling wxPython app for Windows; Single EXE


Vincent Delporte wrote:
Quote:
- py2exe is still the best tool in town to compile Python scripts to
run on a Windows host that doesn't have Python installed, including
wxWidgets/wxPython
Hi Vincent and c.l.p-ers

I'm using PyInstaller (http://pyinstaller.hpcf.upr.edu/) precisely to
"compile" a wxPython-based program. So I'm curious about what makes
py2exe "the best tool...", because I'm about to miss that due to my
ignorance. I learned PyInstaller for something else and laziness kept
me from trying py2exe. Now, the blurb on py2exe's site doesn't sound
better than what I have with PyInstaller.

FWIW, PyInstaller (NB: it's an exe-maker, not an installer) can
compress your binaries using UPX, create single file executables and
works cross-platforms too. It'll even include w9xpopen.exe and allow
custom icons for the executable. It doesn't need setup.py. My
"buildtest.bat" is:

python Makespec.py -X -F -o ecoz ecotools.py grid.py similarity.py
diversity.py
python -O Build.py ecoz\ecotools.spec >pyinstaller_log.txt
ecoz\ecotools.exe test

I've notice that application start time (or rather, 're-start', as it's
more noticeable for the subsequent runs) is much better for the "single
directory" method, because single file will always decompress to a
temporary directory.

All the best,
Daniel

Vincent Delporte
Guest
 
Posts: n/a
#7: Aug 14 '06

re: Compiling wxPython app for Windows; Single EXE


On 14 Aug 2006 09:39:02 -0700, "ajaksu" <ajaksu@gmail.comwrote:
Quote:
>I'm using PyInstaller (http://pyinstaller.hpcf.upr.edu/) precisely to
>"compile" a wxPython-based program. So I'm curious about what makes
>py2exe "the best tool...", because I'm about to miss that due to my
>ignorance.
I didn't know about PyInstaller. I'll check it out. Thanks.
Philippe Martin
Guest
 
Posts: n/a
#8: Aug 14 '06

re: Compiling wxPython app for Windows; Single EXE


Vincent Delporte wrote:
Quote:
Hi
>
I browsed the archives, but since some messages date back a bit, I
wanted to make sure that
>
- py2exe is still the best tool in town to compile Python scripts to
run on a Windows host that doesn't have Python installed, including
wxWidgets/wxPython
>
- there's no way to build a single EXE, to make deployment easier (if
multiple files, I need to build an installer with eg. NSIS or
InnoSetup)?
>
Thank you.
Hi,

Yes there is a way to make one .exe/.msi for everything ... but it does
require purchasing a tool such as VC++.

I have python + wxWindows + my stuff + many other libraries in one installer
(takes 120 Megs (sigh))

Philippe

Vincent Delporte
Guest
 
Posts: n/a
#9: Aug 15 '06

re: Compiling wxPython app for Windows; Single EXE


On Mon, 14 Aug 2006 17:46:11 -0500, Philippe Martin
<pmartin@snakecard.comwrote:
Quote:
>Yes there is a way to make one .exe/.msi for everything ... but it does
>require purchasing a tool such as VC++.
>
>I have python + wxWindows + my stuff + many other libraries in one installer
>(takes 120 Megs (sigh))
I know. An empty frame with wxPython runs at ... 12MB :-/
GHUM
Guest
 
Posts: n/a
#10: Aug 15 '06

re: Compiling wxPython app for Windows; Single EXE


Daniel,

I am using py2exe since more then 4 years, so I am rather biased.

I read PyInstaller page and was positively impressed by the manual and
all the good words.
There is one major difference which will keep me with py2exe:

with PyInstaller and single file there is:
"When first started, it finds that it needs to extract these files
before it can run "for real"."

and with py2exe:
Changes in 0.6.1:

* py2exe can now bundle binary extensions and dlls into the
library-archive or the executable itself. This allows to
finally build real single-file executables.

The bundled dlls and pyds are loaded at runtime by some special
code that emulates the Windows LoadLibrary function - they are
never unpacked to the file system.

this "they are never unpacked to the file system" is the USP of py2exe
to me at the moment.

What is less then optimal with both packages, is that MSVCR71.DLL needs
to be distributed separately :(

Harald

ajaksu
Guest
 
Posts: n/a
#11: Aug 17 '06

re: Compiling wxPython app for Windows; Single EXE


GHUM wrote:
Quote:
and with py2exe:
Changes in 0.6.1:
>
* py2exe can now bundle binary extensions and dlls into the
library-archive or the executable itself. This allows to
finally build real single-file executables.
>
The bundled dlls and pyds are loaded at runtime by some special
code that emulates the Windows LoadLibrary function - they are
never unpacked to the file system.
>
this "they are never unpacked to the file system" is the USP of py2exe
to me at the moment.
Thank you very much, Harald, this is very important. As I mentioned,
PyInstaller single file has a bad start up time... your information is
enough for me to dive in py2exe for good :)

Biased or not, you may have performed one more conversion ;)
Daniel

Closed Thread