== Using InnoSetup to create an installer == The following shows a sample Inno``Setup script to create an installer for the sample wxPython application shown on the [[py2exe]] page. == What Objects are Involved == You will need the following * [[py2exe]] * [[http://www.jrsoftware.org/isdl.php|InnoSetup]] I use the Quick``Start package as it includes the IS``Tools which has a nice wizard to help you get going in creating the script you need to create. == Process Overview == Freeze your application using e.g. [[py2exe]] and then create and run the Inno``Setup installer script, a sample is shown below. == Special Concerns == I use Inno``Setup version 5.2.3 with IS``Tool version 5.2.1, have not yet tried the newer version which is supporting Unicode. == Code Sample == Following is the script to create an installer for the little sample application shown on the [[py2exe]] page. The script should be pretty easy to understand. Should a command not be clear please check the help included with Inno``Setup. The script assumes the following folder structure. application work folder * setup.py * samplewx.py * dist folder * iss-installer folder * samplewx.iss * output folder will contain the installer exe after you compile it with Inno``Setup {{{ #!pascal ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; then did a few changes to make maintenance, move to other folder easier ; ; define the path to your work folder #define BaseFolder "C:\Dev\aaTests\py2exe\simpleWx" ; get version information from the exe #define ExeName BaseFolder+"\dist\simplewx.exe" #define AppVersionNo GetFileVersion(ExeName) #define AppMajorVersionIdx Pos(".", AppVersionNo) #define AppMinorVersionTemp Copy(AppVersionNo, AppMajorVersionIdx +1) #define AppMajorVersionNo Copy(AppVersionNo, 1, AppMajorVersionIdx -1) #define AppMinorVersionNo Copy(AppMinorVersionTemp, 1, Pos(".", AppMinorVersionTemp)-1) ; define some more stuff, mainly to just keep it all at the beginning #define MyAppName "My Program" #define MyAppPublisher "My Company, Inc." #define MyAppURL "http://www.example.com/" #define MyAppSupportURL "http://www.example.com/support" #define MyAppUpdatesURL "http://www.example.com/downloads" #define MyAppExeName "simplewx.exe" #define OutputFileName "setup-simplewx" [Setup] ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{451B698D-E97F-444E-9FA9-B7180E450563} AppName={#MyAppName} AppVersion={#AppVersionNo} AppVerName={#MyAppName} version {#AppMajorVersionNo}.{#AppMinorVersionNo} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppSupportURL} AppUpdatesURL={#MyAppUpdatesURL} ; following should probably be something like "{pf}\yourappname" for a real application DefaultDirName=c:\temp\samplewx DefaultGroupName=simplewx - py2exe package sample AllowNoIcons=yes OutputBaseFilename={#OutputFileName}_{#AppVersionNo} ; bzip/9 is better by about 400KB over zip/9 and lzma is even better Compression=lzma/ultra ; following would reduce size a bit more ;SolidCompression=yes [Languages] Name: english; MessagesFile: compiler:Default.isl [Tasks] Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked [Files] Source: ..\dist\simplewx.exe; DestDir: {app}; Flags: ignoreversion Source: ..\dist\python26.dll; DestDir: {app}; Flags: ignoreversion Source: ..\dist\w9xpopen.exe; DestDir: {app}; Flags: ignoreversion Source: ..\dist\lib\*; DestDir: {app}\lib; Flags: ignoreversion recursesubdirs createallsubdirs Source: ..\dist\Microsoft.VC90.CRT\*; DestDir: {app}\Microsoft.VC90.CRT; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName} Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon [Run] Filename: {app}\{#MyAppExeName}; Description: {cm:LaunchProgram,{#MyAppName}}; Flags: nowait postinstall skipifsilent }}} === Other wiki pages to check === * CreatingStandaloneExecutables === Comments === Please feel free to provide any feedback on this page either here, on the wxPython-user list or to werner.bruhin at free.fr.