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:
- In Vista, non-admins cannot install to Program Files, but this is the
recommended directory for applications: Applications are strongly encouraged
to be installed in Program Files, and all data files written to the application
data folder as they will not write to the apps folder is program files.
Any user who is not an admin needs to be directed to right-click on your
app's setup program and select "Run as Admin".
When the
user has the UAC enabled, is logged in as the local administrator, and runs a program (either
a setup or a regular program), they must use the "Run as administrator"
feature. Otherwise they will not have administrator
privileges.
- OCX's must be registered, but that's not a problem as long as only this
user runs the app. Non-admins can only write to HKCU in the registry.
If they write to HKLM it seems to write, but is actually written to a virtual
part of the directory that is only valid for them (it does not affect other
users).
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
- Create a directory of the files you want to install
- Open a new project in ISTool
- Go to the files section
- Drag the files from your directory into ISTool
- Set the output folder for any files that don't go to your app folder
- Try running the compiler. You will be told what items MUST be filled
in for the project.
- Fill in the required item (If you have any questions about an item the online help is great)
- Repeat until your script compiles
- You now have a working program and have learned the basics of Inno-setup.
- 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
- IsTool (Alternative to the IDE
provided with Inno Setup)
- Inno Setup Generator,
a.k.a. ISPP, a.k.a. ScriptMaker (provides conditionnal compiling, compile-time
variables, additional built-in functions)
- Inno Setup Script #Includes,
a.k.a. ISSI; set of functions, including ISSI Download to fetch files from
a remote host)
- ISX
Download DLL (to add Internet support)
- ISFormDesigner
- Inno Setup - Assimilation Report
- Inno
Setup: Commented Install Script
- Inno Setup Frequently
Asked Questions
- HOWTO: Install
Visual Basic 5.0 & 6.0 Applications
- Inno Setup Extensions Knowledge
Base (including Functions
to Start, Stop, Install, Remove a Service)
- innounp, the Inno Setup
Unpacker
- My
Inno Setup Extensions (Most have been added to Inno, but some can be
had as add-on's.)