Quick Guide to InnoSetup5

Introduction

Just like NSIS, InnoSetup is a well-known, feature-rich, open-source compiler to create installers on Windows. Editors such as ISTool are available to make it easier to build source scripts.

"The only two things I don't like about Inno is that 1. I can't easily set up a file association between .iss and the compil32.exe so that I could open Inno by clicking on an iss script and 2. when I re-install an app, I get another version of uninstall.xxx. But like I said, the price was right, the support is good, and the community is helpful."

Setup

Just run the installer. While you're at it, you might want to also download the Inno Setup Quickstart Pack, and other third-party add-on's . Help is available in ISetup.chm. More help is available online.

Installing VB programs as non-admin

Here are things to take into account if you want your program to install and run on XP and Vista without administrative rights:

Writing scripts

Minimal script

[Files]
;List of files to pack into the installer, each with its destination directory
 
[Setup]
;Variables go here
AppName=My Dummy App
AppVerName=1.0
DefaultDirName={pf}\My Dummy Dir

Setup program in French

To have Inno create an installer that displays the UI in French:

[Languages]
Name: French; MessagesFile: compiler:Languages\French.isl

Using the Inno Setup IDE

(from the online help) Inno Setup Scripts are arranged into sections. There are two different types of sections: those such as [Setup] whose entries contain directive names and values (in the form Directive=Value), and those such as [Files] whose entries are divided into parameters.

Each parameter consists of a name, followed by a colon, and then a value. Unless otherwise noted, parameters are optional in that they assume a default value if they are not specified. Multiple parameters on a line are separated by semicolons, and can be listed in any order.

The value of a parameter is traditionally surrounded in double quotes (") when it contains a user-defined string, such as a filename. Using quotes is not required, though, but by doing so it makes it possible to embed leading and trailing spaces in the value, as well as semicolons and double-quote characters.

The majority of the script entries can have constants embedded in them. These are predefined strings enclosed in brace characters { }.

There are two optional parameters that are supported by all sections whose entries are separated into parameters, except [Types], [Components] and [Tasks]: Components and Tasks.

The [Code] section is an optional section that specifies a Pascal script. A Pascal script can be used to customize Setup or Uninstall in many ways.

Using the ISTool IDE

  1. Create a directory of the files you want to install
  2. Open a new project in ISTool
  3. Go to the files section
  4. Drag the files from your directory into ISTool
  5. Set the output folder for any files that don't go to your app folder
  6. Try running the compiler.  You will be told what items MUST be filled in for the project.
  7. Fill in the required item (If you have any questions about an item the online help is great)
  8. Repeat until your script compiles
  9. You now have a working program and have learned the basics of Inno-setup.
  10. As you need something more advanced, the samples that come with Inno setup and the online help have most of the answers

If you want to pack only one language: In the Languages section, right-click, select New Item, and fill the Messages File section.

Sample

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
 
[Setup]
AppName=My Program
AppVerName=My Program 1.5
AppPublisher=My Company, Inc.
AppPublisherURL=http://www.mycompany.com
AppSupportURL=http://www.mycompany.com
AppUpdatesURL=http://www.mycompany.com
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
 
[Tasks]
; NOTE: The following entry contains English phrases ("Create a desktop icon" and "Additional icons"). You are free to translate them into another language if required.
Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"
 
[Files]
Source: "D:\Program Files\Inno Setup 4\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
 
[Icons]
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
Name: "{userdesktop}\My Program"; Filename: "{app}\MyProg.exe"; Tasks: desktopicon
 
[Run]
; NOTE: The following entry contains an English phrase ("Launch"). You are free to translate it into another language if required.
Filename: "{app}\MyProg.exe"; Description: "Launch My Program"; Flags: nowait postinstall skipifsilent

Q&A

How to have Inno increment the build version automatically?

Article here.

An alternative, also using ISSP, is: VersionInfoVersion={#GetFileVersion("Application.exe")}

How to tell Inno to check for admin privileges?

[Setup]

PrivilegesRequired=admin

[Messages]

AdminPrivilegesRequired=put whatever you want it to say here.

Resources

Learning

Sites