Discovering something new – Inno Setup

A few months back while creating a screensaver file I discovered this program called Inno Setup. This is an excellent (and free) program that allows you to create install files for Windows programs.

Now, I’m sure it’s has a massive scope for distributing applications, but my uses for it are a lot more basic for the moment. So, aside from executing a program (such as a screensaver installer), you can add icons, files, and create folders in the start menu, among many other things that I have absolutely no understanding off. The code format is also pretty easy to understand for a beginner:

Starting off

Inno Setup uses “Directory Constants”, these are in curly brackets and are things like:

{app} – The application directory that the user creates when the program is installed
{win} – The WINDOWS folder
{src} – The folder where your Setup files are located
{group} – Path to the start menu folder

So, first of all add the below to your ISS file.
[_ISTool]
EnableISX=false

Adding some files

These could be a URL link file, icons, or any other files you would like to include in the installer. When you are compiling the install file these source files should be in the root folder, and when the installer is run it will output the files into program files folder in the destination folder you define.


[Files]
Source: your_application.exe; DestDir: {app}\your_destination_folder;

If you want to use files in your installer but want to keep them external from the installer file you can use a "Flag".

Source: {src}\your_icon.ico; DestDir: {app}\your_destination_folder; Flags: external;

Add files to the Start Menu

This section lets you create items in the Start Menu and include icons for them. You will need to have defined this in the [Files] section first.

[Icons]
Name: {group}\your_file_name: {app}\your_file; IconFilename: {app}\your_destination_folder\your_icon.ico;

Run an application

This section will run an application you have added to your installer. You can also run any existing Windows programs, such as the control panel or other applications.

[Run]
Filename: {app}\your_application.exe;

Finally, some set up nonsense

[Setup]
OutputDir=(Where you want the installer file to go)
SourceDir=(Where all the source files for the installer are)
OutputBaseFilename=(What you want the installer file name to be)
Compression=lzma/ultra
AppName=(What you want the application to be called when it is installed)
AppVerName=(Application version name)
SetupIconFile=(The location of the icon that you want to be applied to the installer)

AppPublisher=(Who is publishing the application, such as company name)
AppVersion=(The version of the application)
DefaultGroupName=(This will be the name of the Start Menu folder, i.e. the {group} constant)
DefaultDirName=(The will be the name of the directory for the application)

SolidCompression=true
AppCopyright=(Your application copyright information)
ShowLanguageDialog=yes

Well, that's the basics

Find out more information from the Inno Setup Knowledge Base.

Previous Next

Leave a Reply