Wednesday, December 05, 2007

Creating a windows installer from your WxPython application.. a love story.

I've just finished wrestling with a small wxpython application I wrote a few years back for our bookkeeper. It needed minor updating with a couple of new features. Now that I've finished the process here are a few remarks:

  1. Python is a lovely language. After about 14 months of not touching this app (or much of python in any case) it only took a few minutes of review to get back up to speed on it. Granted, I made judicious use of comments and verbose variable naming when I wrote it, but dang is it ever nice clean, clear and simple code.
  2. Once I had the thing running I downloaded and installed the latest version of py2exe (this app is to be installed on an XP machine). This little gem is invaluable in making .exe files from your .py files  and not requiring a Python install on the machine which is going to run the application. Our bookkeeper has no interest in what Python is, never mind running it.
  3. I love the Nullsoft Installer System (NSIS). It's an open source system for creating professional looking Windows installers. No funky console windows or command line gobble-de-gook for the person installing it - typical modern looking windows install  - wizard style.
  4. Now the Nullsoft installer system is scripted (you have to create a script file to direct the setup) which allows for a lot of power and customization. But if you're like me and have no interest in building these things by hand, you can use the wonderful HM NIS Edit application which lets you set up the whole thing through a nice friendly wizard.

So in the end, with the combination of my original .py file, py2exe, NSIS, and the HM NIS Edit, I have a very professional looking windows install file after about 5 or 10 minutes work. Brilliant!

Blogged with Flock

1 comments:

JasonC said...

You're a life saver man! Brilliant indeed!