Building the Installer

After running our project through py2exe, we can now use any installer builder software to create installer executables. There are many to choose from; some are commercial (and very expensive), but there are some very good free options. We are going to use the free software, Inno Setup, which produces professional-looking installers. You can download Inno Setup from www.jrsoftware.org/isinfo.php.

Inno Setup compiles the executable from a script file (extension .iss), which is a simple text format that contains information about the files in your application and how you want the installer to look and behave. You can edit these ISS files by hand in any text editor, but I like to use ISTool (www.istool.org/default.aspx), which is an easy-to-use graphical front end for Inno Setup.

Listing B-2 is an ISS file produced with ISTool, which creates the installer executable setup.exe in a folder called Output.

Listing B-2. Script for Inno Setup (ants.iss) [Setup]

SolidCompression=true

AppName=Ant State Machine

AppVerName=Ant State Machine 1.0

DefaultDirName={pf}\ant state machine

DefaultGroupName=ant state machine

ShowLanguageDialog=yes

[Files]

Name: {group}\Launch Ants; Filename: {app}\antsstatemachine.exe; WorkingDir: {app} Name: {group}\Uninstall Ants; Filename: {uninstallexe}

If you double-click setup.exe, it will display a simple wizard (Figure B-1) that will guide you through the installation process and then copy files and create icons in the Start menu. Listing B-2 is probably the simplest installer you can produce—see the Inno Setup documentation for more information on how to change the look and feel of the installer.

Installer Inno Setup Them
Figure B-1. Installer produced with Inno Setup

■Tip An alternative to Inno Setup is the Nullsoft Scriptable Install System (http://nsis.sourceforge.net/ Main_Page), which is also free and produces high-quality installers. Another option is BitRock InstallBuilder (http://bitrock.com/products_installbuilder_overview.html), which is a commercial product that has a free license for open source projects.

Was this article helpful?

0 0

Post a comment