How I distribute Python apps on Windows.

(py2exe and InnoSetup)

Brian Dorsey - brian@dorseys.org

Open space: Sunday 11:50am

Teaser

(demo)

Me

my biases

Me

Use Python

Me

(mostly on Windows)

Me

utilities & glue applications

command line or windows services

Me

I'm really lazy.

This Talk

based on my experience - works for me

This Talk

This is for applications, not libraries.

This Talk

Examples based on command line apps.

Same steps for services and GUI apps.

This Talk

short talk, one guy's experience

Open space: Sun 11:50am @ Lambert

Py2exe?

What is it?

Why

Most Windows machines don't have Python by default.

Why

Save work for your users.

Why

Each app has it's own version of Python...

and libraries!

Why

Feels natural to Windows people.

Py2exe - Hello World

(demo)

Py2exe - a bit more

(demo)

InnoSetup

it makes installers

Integrated Example

(demo)

Problem

eggs

Solution

easy_install -Z

distutils.cfg

always-unzip = True

Problem

finding the application directory

Solution

(code)

Problem

Windows services work fine for a while then freeze.

stdout/stderr have a fixed buffer, once full, your application freezes.

Solution

redirect stdout/stderr

sys.stdout = open('nul', 'w')

Troubleshooting

Missing modules?

try to run the application

add: import module

Check the wiki: http://py2exe.org/

Troubleshooting

Strange failures when starting the app?

Delete the build and dist folders.

Thanks!

Open space: Sun 11:50am @ Lambert