Inno setup does not display a greeting message. Creating a Windows application distribution in Inno Setup. Inno Setup script sections

Most users who are not particularly familiar with computers are interested in what Setup is and what its functions are. Sometimes the answer to this question is quite simple. However, in many cases, this component is associated with many problems on the computer.


Thus, you should understand what Setup is and understand what to do if problems arise with this file. It is worth noting that this is not as difficult as it might seem at first glance.

Language norms

First of all, you need to understand that this is a translation of the word. Quite often it is he who provides assistance to the user and makes it possible to understand the meaning of the operation. What is Setup? To get the answer to this question, you should consult an English dictionary. This word translated means “installation” (noun) or “install” (verb). In other words, something that installs on a computer. It is worth noting that without this component it is difficult to imagine the operation of the operating system. Is Setup really that important? This should be found out. Especially when the computer systematically produces various errors.

For computer What is Setup?

In addition to the main translation, there is also a computer interpretation of this application. It is most understandable for modern users. It is worth noting that “Setup” means a program designed to install something. Its main component is Setup.exe. In other words, it is an installation or executable file. What happens on the computer after startup. What characterizes Setup? For example, among the executable documents, you can select various applications, games (installing them), and launching settings. There is also Bios Setup. This is the name of the settings that make it possible to work with the computer. In other words, with the universally popular “Bios”.

It is impossible to imagine a computer without “Setup”. When these files are not present, the user will not be able to execute various commands. It will be impossible to install content and programs. Setup.exe is present in every application or game. It helps launch the installation program, which allows you to quickly install the required content into the operating system. To activate this feature, you need to double-click on the executable file.

Rules of circulation

It is worth noting that the Setup.exe file needs special handling. Especially when it comes to installing a game that was downloaded from the Internet. You need to figure out what helps in this difficult matter. First, you just need to close all third-party applications to avoid possible failures. Next, you can go to the folder containing the executable file. To start, you will need to double-click on “Setup.exe”. When the Windows 7 or higher operating system is installed, the computer will ask the user for permission to start the process. A window will pop up on the screen with basic information about the manufacturer-creator, as well as the location of the document. There you will need to answer “Yes” to launch, or “No” to cancel the installation of something.

Once confirmed, a window will appear with easy navigation. First, the system will greet the user and notify that it will be installed. Then you need to follow all the instructions in the “Installer” and complete the process. After this, the specific application will be installed. It is very important to never move Setup.exe from the root content folder. It is also not recommended to uninstall it or uninstall it even after installation on your computer. This may cause applications to stop working. It is worth noting that “Setup” is also an application that is required not only to install something, but also to launch it. All shortcuts contained on the desktop that are involved in activating programs end up with an address with the “exe” extension.

Process

Among the executing processes you can sometimes find “Setup”. It is worth noting that some users are wary of this. Setup works and monitors running and running processes. Thus, it acts as a kind of filter. If you disable it, the operation of the operating system becomes uncontrollable. In other words, it is impossible to install and run applications and games normally. Therefore, there is no need to try to engage in this amateur activity. Sometimes this process takes a lot of computer resources.

Virus

Let’s say a previously safe “Setup” can become a real virus. In this case, it may be located somewhere in the operating system and encrypted as an ordinary executable file. Such computer infections often attach themselves to applications that are most needed. The virus is activated continuously after the required program is launched. It is worth noting that an antivirus is not always able to cope with the problem. Initially, detecting a virus that is disguised as “Setup.exe” is quite difficult. If you suspect that your computer is infected, you will have to close all applications and scan the system for the presence of infection. In this situation, an antivirus will come to the rescue. The following programs work well with Setup:

Avast;
Nod32;
Dr.Web.

If the scan confirms your concerns, there is no need to rush to remove the threat. It must be remembered that after this you will not be able to launch the application that contained the virus. To carry out effective and proper treatment of your computer, you need to seek help from service center specialists. They will find and neutralize the threat without causing harm to the user’s files and documents.

Spy

There is another fairly common scenario. We are talking about the presence of a special spy on the computer. It is capable of encryption in processes such as Setup. This infection is designed to detect and steal user personal data. For example, addresses and emails, bank card numbers, logins and passwords for pages, etc. It is worth noting that it is not particularly pleasant to identify a spy on a computer, especially when it is encrypted under Setup.exe.

Using an antivirus in this case is not always effective. You will need to additionally download and install a special antispyware program. For example, SpyHunter. It is freely available and easy to use. You need to launch the application, and then start checking. When the results are obtained, you can safely remove the threats. Don’t forget to visit the task manager and then end the Setup.exe process. Next, you should restart your computer. The “Setup” will again appear in the dispatcher, but you shouldn’t be afraid of it either.

Thus, the article addressed the question of what Setup is. As you can see, this is a very important file. Sometimes it can bring a lot of problems. To avoid trouble, you should simply watch what is installed on your computer and downloaded. It is recommended to always run only processes that are trustworthy.

Main functions

  • creating a single EXE;
  • splitting the installer into disks;
  • several types of program installation (full, custom, minimal);
  • possibility of uninstallation;
  • compression functions (deflate, bzip2, 7-Zip);
  • comparison of version information, replacement of files that are used during installation by the installer;
  • creating shortcuts in a specified location;
  • password-protected and encrypted installations;
  • silent installation and removal;
  • creating registry entries and INI files.
Advantages and disadvantages

Advantages:

  • free distribution;
  • Russian language support;
  • convenient and intuitive interface in the form of a Wizard;
  • integrated script engine in Pascal language;
  • possibility of multilingual installation.

Flaws:

  • manual editing of scripts.
Alternatives

Install Creator. A free application for creating your own unique installers for various programs. Allows you to use custom icons, write values ​​in the registry, automatically install fonts, and download data from servers.

Install Wizard Creator. A simple free program with which you can create application installers. The operation is performed in several steps: specifying a name, adding files, pressing a button.

Work principles

To create a single installation file for the program, run Inno Setup, click on the “File”, “New” button and launch the Wizard.

Creating an installation file

In the next window, provide basic information about the application: name, version, developer, home page, etc.

Then, in a special field, you need to enter the exe file that launches the installed application, and also add a list that includes all its components and files.

If a license file exists, specify the path to it in the next window. It is also possible to create a Readme.txt, write a message, or leave the lines empty.

  • installation file name;
  • a place to place the compiled file;
  • installer shortcut.

In the last window you need to leave everything as it is, which will simplify the installer script.

After specifying all the necessary parameters, the program will create an application wrapper.

Application file

Inno Setup will help you create a full-fledged professional installer that will have the necessary protection and a number of mandatory functions.

Part 1

The user's familiarization with the program most often begins with launching the installer. The appearance (“packaging”) and functionality of the product are determined by the developer. The user needs to be able to control the process by setting the necessary installation parameters. For the developer, it is important that, at a minimum, his program is installed correctly, and the installer is compatible with the necessary platforms.

There are a lot of solutions for creating installers. The most commonly used subsystem is the Windows Installer, which is already included in the operating system toolkit. But there are also alternative solutions - both paid and free, with varying functionality. They can often be used to create packages with an installer that is independent of the Windows Installer.

The guide includes all kinds of systems for creating installers, the main aspects of their review are as follows:

  • Development environment, interface, scripting support
  • Working with a project, types of packages created, possibilities for importing projects from other development environments
  • Custom installer options: support for languages, profiles and other options
  • Extension support
NSIS (Nullsoft Scriptable Install System)

NSIS is a free and well-known toolkit for creating installation packages in the Windows environment. Distinctive features are compactness, scalability, support for plugins and localizations. Other NSIS features: support for scripts, various installation options (including multiple projects within one installer), creation of web installers.

NSIS distributions are script-based. Variables and functions completely control both installation and uninstallation of the product. Using scripts, you can add files and directories, make changes to the registry, edit text and binary files, create patches, manage environment variables, and even access the Windows API (via extensions).

The syntax of the NSIS language is quite simple and easy to read, and the main documentation for it is available. Moreover, the program comes with a large number of examples (nsi files are available in the Examples folder). Any code editor is suitable for editing nsi scripts, where you can turn on syntax highlighting without much effort. Many tasks can be immediately unified if you use a special plugin for the Eclipse IDE, or . Venis is an intuitive visual environment for creating scenarios.

It is convenient to work with NSIS in conjunction with other programs, for example (see below).

If there is a need to expand the capabilities of the installer, you can add certain functions. Plugins are written in C, C++, Delphi or other languages. Ready-made examples of extensions are available. The functions are varied: from visual effects of the installer to creating patches and accessing the Windows API.

You can compile the installer using the makensis tool, having previously selected the compression type - ZLib, BZip2 or LZMA. In addition, the installer itself takes up little space - only 34 KB.

The installer's graphical interface is available in one of two versions - Classic or Modern. The more functional Modern (version 2.0 is currently in use) allows you to create installation wizard pages using text, fonts, images, dialogs, options, etc. At this stage, the program will provide assistance. It allows you to quickly design an interface and save the resulting result in the nsdinc format, which can then be easily integrated into an .nsi script.

Summary . The NSIS environment has long proven itself, and as proof - those who use its capabilities. A simple scripting language, the presence of all the necessary functions, the ability to expand, the availability of basic and additional tools - due to all this, NSIS is a strong competitor to programs in this category.

Inno Setup

Inno Setup is a free toolkit for creating script-based installers. Among the main features of the product are work with all versions of Windows OS (Windows 2000 and higher), extended support for 64-bit applications, custom installation types, a built-in preprocessor and a powerful scripting language based on Pascal.

The scripts have a structure typical of ini-format configuration files, so the code is quite readable and easy to edit. The document is divided into sections, and each of them is responsible for a specific task of the installer, respectively. There are two types of sections - with parameters and “directive-value”.

Developers familiar with Pascal will benefit from the fact that Inno uses a “related” language - . Scripts are responsible for adding new options, creating an interface, calling files or libraries, custom actions, etc. The Inno Setup working folder contains example scripts (also available in the compiler menu). By default, Inno Setup includes the Compiler IDE script compiler. For a quick start, it is also recommended to install Inno Script Studio. This project editor is included in the QuickStart Pack edition, you can download it. To simplify tasks, a visual script editor can be useful.

The easiest way to create an installer is to use the step-by-step Inno Script Studio setup wizard. Here you can find information about the product, program coordinates, license file and other data, localization languages, and compiler options. Subsequently, the project is available for compiling, debugging or modifying the resulting script in the editor window.

The Inno Script Studio editor is available in Russian. It is much easier to configure the project sequentially, moving through sections, rather than creating a script from scratch. When adding a new element, changes are made to the script code, the syntax is highlighted, and the code is appropriately divided into sections (, , ...).

The editor sections are not grouped, but the structure is quite recognizable. Logically they can be divided as follows:

  • Distribution contents: Files, Directories, Icons, INI files, Registry
  • Messages and user messages,
  • User options: Types, Components, Tasks, Languages
  • Actions: Execute, Remove before installation, Execute before uninstallation, Remove after uninstallation
  • Script code: Pascal code, Pre-compilation steps, Post-compilation steps

Russian localization is sometimes misleading, as is always the case with a not very high-quality translation.

Other features of Inno Setup include silent installation and uninstallation. The user has various types of installation and localization to choose from. The installer can be encrypted, digitally signed, or password protected. Bzip2 or LZMA/LZMA2 compression can be applied to the distribution. The interface is in the 2000/XP style, no other options are provided.

Summary . Inno Setup is the closest alternative to NSIS. Allows you to use both a powerful scripting language and a convenient and highly customizable editor, Inno Script Studio, available almost out of the box.

IzPack

Most often, the installer development environment is assigned to a specific platform, and the developer is forced to use different tools for each of them. IzPack solves the issue of cross-platform, using the universal Java development environment for its needs.

The main features of IzPack: XML syntax, integration with various compilation tools, simple and flexible API, localization capabilities.

Among the features of installers created using IzPack are small size and modularity. The distribution is based on an XML document, which specifies all the necessary specifications and defines the functionality of the product. Subsequently, the configuration file is processed in any convenient way, using the command line or . To increase the functionality of the installer, IDE environments such as Eclipse, IntelliJ IDEA or Netbeans can be used. Any code editor is suitable for creating a configuration file.

The XML document specifies information about the project (), interface (), localization (), files (), resources (), panels (), content (- can be packed in raw, gzip, bzip2), etc. As for java , in IzPack it is possible to apply actions (custom acrions) and variables - built-in, user and environment variables (see and).

Panels are designed to create a graphical interface for the installer. With their help, the appearance of the welcome screen, content, text information (readme, licenses), images are determined. Various types of interactive elements are supported (fields, switches, etc.), localization, including Russian. Both the interface and the content can be translated.

To create self-extracting modules, the 7-Zip SFX method is used, using the capabilities of a well-known archiver. A shell called izpack2app is also available for Mac OS. In addition, it is possible to create a web installer; for these purposes, there is an izpack2jnlp shell that uses the capabilities of Java Web Start. IzPack supports a silent installation option.

Summary . IzPack is one of the few cross-platform systems for creating installers. The process of writing a configuration, compiling and debugging is convenient due to integration with development environments and is easy to learn. Among the shortcomings, it should be noted that the resulting installer is significantly outdated (and not original - native).

Excelsior Installer

Excelsior Installer is a free program designed to create installers and updates. The main features are a simple intuitive graphical shell, the ability to integrate with Explorer and NSIS.

Creating a distribution or update is done using a Packager. It contains a step-by-step wizard containing project settings. Based on the project, it is very simple to compile an eight-step installer. According to the description, this can be done with just two mouse clicks, but the following parameters must be defined in the packer:

  • Application files and folders, shortcuts
  • Description: company name, product name, product version

The packer consists of sections Files, Settings and Appearance. In general, it contains a standard list of options responsible for creating a license agreement, selecting an installation directory, shortcuts, registry keys and other parameters. If you study the products, it is easy to discover the following functional “gap”: the installer does not support file associations, DLL extensions, or controls.

As for the available installer options, you can specify an installation profile, depending on the privileges of the current user. The installer supports localization, and the Russian language is available out of the box, the rest is downloaded separately. Possible automatic - silent - installation without requesting data from the user, after installation - checking the integrity of the package or other custom actions.

As already mentioned, Excelsior integration with NSIS is possible. Excelsior Installer, in fact, acts as a full-fledged GUI for NSIS; project settings are exported without problems.

Along with this review participant, it is worth highlighting another related product - Excelsior Delivery. For the most part, Excelsior Installer's functions are duplicated. But there are also several additional functions: adding OLE and ActiveX elements, file associations, libraries to the system, creating user surveys. The licensed version of Excelsior Delivery ($99) also allows you to apply branding to the installer. If this option is not important, you can download a non-commercial version of the program.

Summary . Excelsior Installer is a simple and very intuitive system for creating distributions, can be used as an add-on to NSIS. The other side of the coin is the average functionality of both Excelsior Installer and Delivery.

WiX Toolset

WiX (Windows Installer XML) is a free set of tools for creating installers (Windows Installer) using the XML specification. Features: command line interface, integration with IDE, process automation, support for basic and extended support for Windows Installer.

The core of WiX consists of a compiler (candle), linker (light), librarian (lit), decompiler (dark), installation bootstrapper (burn) and other utilities. With their help, you can create installation packages.msi, merge modules.msm, patches.msp.

Creating an installer consists of several main stages: developing a script, checking it, processing it with a preprocessor, compiling and linking. The MSBuild platform is used to build the installer and automation in general. Automation is one of the main advantages of WiX when working with fairly resource-intensive projects.

The source code is in XML format (file extension wxs). The script describes all stages of installation, starting with a description of the project and ending with post-installation actions. You can edit it in any editor that supports this format.

WiX pleases with its integration capabilities: WiX Toolset provides a command line interface. To work with a project in Visual Studio (IntelliSense module), you will need the .

In difficult situations or in the absence of time to study scripts, the graphical shell will be of good service. Its main advantages are the import of existing wxs projects, structuring xml data with easy reading and navigation. Using the wizard, it is also easy to create an installation file from scratch. Moreover, this is far from the only such tool (see).

Summary . In this case, the XML specification decides a lot. WiX allows programmers to operate with source data without resorting to a graphical shell. WiX includes all the necessary tools, in addition to this, the functionality of the installer can be improved through extensions.

If you decide to start distributing your programs, then you cannot do without an installation distribution. Nowadays, almost all programs have an installer, usually called Setup.exe. In this article we will look at an example of how to build an installer for an Access application and look at some features that you need to know.

As mentioned earlier, Access does not allow you to make an executable file that can run without Access. But at the same time, Microsoft suggests using the Microsoft Office Developer package, which also includes a license to distribute the Microsoft Access runtime program, to solve the problem. I will dwell on this in more detail.

Microsoft Access runtime is a version of Access that allows users to run, but not modify, an Access application. It only makes sense to install Microsoft Access runtime instead of the full version if you need licensing integrity, and the client running your database does not have an Access license. In this case, you will have to buy ODE (Office Developer Edition).

Then, along with its purchase, you receive some additional tools and, most importantly, the RIGHT to install Run-time versions of Access along with the database you developed. In this case, there will be no claims against the client regarding illegal use of Access. Otherwise, each client needs to buy an MS AAccess license.

The ODE package includes a “distribution creator” that includes your MDB and Run-time version in the distribution. All the libraries necessary for creating Run-time are already included in the full version of Access (even without ODE). But there is one BUT (this is for those who are concerned about licensing “cheat”):

If you do not buy it officially, then clients will still not have the right to use even the Run-time version.

In general, if we consider real situations with the sale of applications on Access, then only a few developers (we are talking about Russia) actually buy license packages. As a rule, these are those for whom “at a certain level of business development, the question of whether to buy or not to buy loses its relevance” - or, more simply, who can afford to buy a license package for $600 - $1000. It’s interesting to then listen to them swear on forums about the operation of such programs. As far as I understand, there are the same “jambs” as in the pirated versions. Therefore, I will not urge you to use only free or pirated versions of Office for your programs, but I would not recommend using a licensed one either (see above).

Interestingly, the full version of Access can be launched in runtime mode by specifying the /runtime switch on the command line. For example, create a shortcut on the desktop, right-click on it, in the dialog box that appears in the object field, write something like this: (this is for Office 2000 - XP, but for 2003 you will need to fix it instead of Office10 - Office11)

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" "D:\Bases\My Database.mdb"/runtime

and in the “Working folder” field:

Now let's launch the application through this shortcut. The Access project window will open, but the Access shortcut and standard toolbars will no longer be there. This is runtime mode.

For first-time developers, distributing Access applications through the Microsoft Office Developer suite may not be an option. After all, it costs money, and not little. We'll look at another method, using the free installer Inno Setup. Of course, there are others, both paid, for example InstallShield, and free installers. They differ in ease of use and the size of the distribution kit created.

Inno Setup is a freely distributed installer for Windows programs. English versions appeared back in 1997, now Inno Setup is translated into several languages, and installers can be created in more than 20 languages. Inno Setup is superior to many commercial installers in terms of features, stability, and size of the files it creates.

Main characteristics:

  • the program can compare file version information
  • move used files
  • register DLL/OCX/FNT/TLB and standard libraries
  • install fonts
  • checks whether certain programs are active
  • creating shortcuts for quick access (for example, through the start menu or on the desktop)
  • writing to ini files
  • built-in machine for writing scripts in Pascal language
  • supports multilingual installation
  • installation and uninstallation by default
  • all code is available (Borland Delphi 2.0-5.0)
  • password protection for setup
  • in case of cancellation during execution, all actions will be returned to their original state
  • supports all 32-bit versions of Windows (95, 98, 2000, 2003, XP, Me, NT 4.0)
  • creates the creation of one exe file, which greatly simplifies the installation process of your program
  • standard Windows 2000/XP interface
  • user-centric (e.g. full, minimal, custom)
  • all uninstallation tools
  • file installation: built-in support for "deflate", bzip2, 7-zip LZMA compression files

Also, starting from version 2.0.6, Inno Setup includes full support for MBCS. Earlier versions do not include this last property. But it does not support Web installation.

The peculiarity of creating an installer in Inno Setup is that installers are created using scripts - simple ASCII text files reminiscent of .INI files. Scripts are easier to edit than, for example, working with the Installshield interface. Scripts have the extension ".iss" (inno setup script). It specifies all the installer parameters, and during installation, the program associates itself with these files. The script is divided into sections, the names of which are written in square brackets. Within sections there are keywords and instructions that the compiler can read and execute.

Comments begin with a semicolon at the beginning of a line and can be placed anywhere in the script. Comments in a block are not possible, as is placing a comment in the middle of a line. The latter is allowed by the compiler, but subsequently, when executed, leads to an error.

; -- Sample1.iss --
; Demonstrates copying 3 files and creating an icon.

The order of the sections does not matter. All of them (with the exception of ) are arbitrary. A keyword is assigned a value using an equal sign (=).

Hints consist of one or more parameters and their options, as well as flags. The parameter, in turn, consists of a name followed by a colon : and a value. Parameters, options, and flags are separated from each other by a semicolon;

Let's briefly look at the main sections:

Section

Meaning

contains instructions on the behavior of the installation routine, as well as how it should look. The AppName, AppVerName, and DefaultDirName keywords are required. All others - as needed
This contains the setup files
shortcuts (icons)
The ratio of components to the type of installation routine
allows you to create new empty folders
writes to INI files
the first action during installation, systax corresponds to the section
allows specific changes to the text
makes an entry in the register
executes other programs after the data has been successfully installed, but before the dialog box is closed
allows additional actions in setup
sets the setup type
last operation during uninstallation. This way the folders and/or files will be deleted
the first operation during uninstallation. Systax corresponds to section
contains information about the language. generally not used

Inno Setup works inside a script with various predefined constants, which usually contain paths. Way of writing: (name). Some constants such as (app) and (group) can/should be predefined by the user. Anyone who wants to define the constants themselves should turn to Alex Yackimoff's preprocessor.

Here are the main Inno Setup constants:

constant

example

(win) path to the Windows directory/folder C:\Windows
(sys) path to the Windows system folder, specifically the System32 folder C:\Windows\System or C:\Windows\System32
(app) path to your own application (program)
(pf) path to program folder C:\Programme
(cf) path to shared data C:\Programme\Gemeinsame Dateien
(dao) corresponds to (cf)\Microsoft Shared\DAO C:\Programme\Gemeinsame Dateien\Microsoft Shared\DAO
(src) path to the installation routine folder at the time of setup R:\
(group) group of programs for the start menu

So, let's look at the problems that need to be solved (we'll define only the minimal ones). Our installer should do the following:

Unzip files to required locations
Create a folder in the program directory (the “Cop” folder is for storing database backups)
Create an application launch menu in Start - All Programs, as well as an icon on the desktop

This is the required minimum. But, of course, this is not all the possibilities of Inno Setup. It’s not for nothing that many developers use it. But in this article I will limit myself to only this; those who want to study the program’s capabilities in more depth can refer to the help system. There are many links on the Internet both to the program and to translations of the help. For example, Inno Setup 5.1.6. and the help for it you can download here... English website of the program http://www.innosetup.com

First, try experimenting by creating an installer using the wizard, and then studying the structure of the resulting script. In principle, I think there is no need to describe in detail what to press where. Inno Setup is so easy to learn that it can be learned without any problems, which is called the “scientific poking method”. Here, for example, is an installer script that performs previously defined tasks (all distribution files are located in the D:\Setup directory.)


AppName=My program
AppVerName=My program. Version 1.0.
AppPublisher=MyProgram, Inc.
AppPublisherURL=http://MyMySoft.ru/
AppSupportURL=http://MyMySoft.ru/
AppUpdatesURL=http://MyMySoft.ru/
DefaultDirName=(pf)\MyProgram
DisableDirPage=no
DefaultGroupName=My program
DisableProgramGroupPage=yes
LicenseFile=D:\Setup\license.txt
InfoAfterFile=D:\Setup\readme.txt
AlwaysCreateUninstallIcon=yes


Name: "desktopicon"; Description: "Create a shortcut on &Desktop"; GroupDescription: "More shortcuts:"


Source: "D:\Setup\Server.mdb"; DestDir: "(app)"; DestName: "Server.mdb";
Source: "D:\Setup\license.txt"; DestDir: "(app)";
Source: "D:\Setup\readme.txt"; DestDir: "(app)";
Source: "D:\Setup\Log.JPG"; DestDir: "(app)";
Source: "D:\Setup\Log.ico"; DestDir: "(app)";
Source: "D:\Setup\Base.mdb"; DestDir: "(app)";


Filename: "(app)\MyProg.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://MyMySoft.ru/"


Name: "(app)\Cop"


Name: "(group)\My program"; Filename: "(app)\Base.mdb" ;WorkingDir: "(app)";IconFilename:(app)\Log.ico
Name: "(group)\Program website"; Filename: "(app)\MyProg.url"
Name: "(userdesktop)\My program"; Filename: "(app)\Base.mdb" ;WorkingDir: "(app)"; IconFilename:(app)\Log.ico;Tasks: desktopicon

You can download an example of how it all works below.

  • Contact "Interface" for additional information/on purchasing products

Downloads

To make it easier to install your programs on users' computers, you will need to create a distribution kit. Today I want to talk about a very powerful and free tool for creating distributions for Windows OS - Inno Setup.

About Inno Setup

Inno Setup, which appeared in 1997, today competes with paid installers and even surpasses many of them in terms of the number of functions and stability. The project home page is located.

Here are the key features of the installer:

      • Supports all versions of Windows since Windows 2000, including: Windows 8, Windows Server 2012, Windows 7, Windows Server 2008 R2, Windows Vista, Windows Server 2008, Windows XP, Windows Server 2003 and Windows 2000. In this case, no update packages are required.
      • Extensive support for installing 64-bit applications on 64-bit versions of Windows. Support for x64 and Itanium architectures (if you are using Windows Server 2003 on Itanium architecture, Service Pack 1 or later is required to install 64-bit mode).
      • The ability to create a distribution kit consisting of one single EXE file for easy distribution on the Internet. Disk partitioning is also supported.
      • Standard installation wizard interface in Windows 2000/XP style.
      • Customizable installation types such as Full, Compact, Custom.
      • Wide range of uninstallation options.
      • File installation: Includes integrated support for deflate, bzip2 and 7-Zip LZMA/LZMA2 compression. The installer can compare file versions, replace used files, use shared file counting, register DLL/OCX and type libraries, and install fonts.
      • Create shortcuts anywhere, including the Start menu and desktop.
      • Creating registry items and INI files.
      • Run other programs before, during, and after installation.
      • Creation of multilingual distributions, including left-to-right languages.
      • Creation of password-protected and encrypted distributions.
      • Support for digital signature during installation and uninstallation.
      • Hidden installation and removal.
      • Unicode support.
      • Built-in preprocessor for additional customization during compilation.
      • Built-in Pascal script engine to perform additional actions during installation and uninstallation.
      • Free source code (Borland Delphi 2.0-5.0 and 2009).

The big advantage of Inno Setup is that it is absolutely free to use, even for commercial use. Although, as a thank you or to support the installer, you can make a donation. There is also a list of everyone who donated $100 or more.

This is what the start page of the standard distribution installation wizard looks like, created using Inno Setup.

About creating a distribution in Inno Setup

Creating a distribution using Inno Setup proceeds as follows:

1. First you create an Inno Setup script. The Inno Setup script is a text file with the extension .iss, which contains the properties of the distribution and a set of actions performed during installation and removal. The script can be created using the standard Inno Setup editor (see picture) or using one of the third-party editors such as Inno Script Studio or ISTool. In this article I will only cover using the standard Inno Setup editor.

2. Then you compile the script, resulting in a distribution.
3. After compilation, you can test and debug the resulting distribution, performing installation and uninstallation.

Installing Inno Setup

To create distributions using Inno Setup, you just need to install the Inno Setup compiler on your computer. The distribution can be downloaded. You can find the download link for the latest stable version in the Stable Release section. At the time of writing, the latest version of Inno Setup was 5.5.5, see picture. To download the distribution, click on the link “Random site" next to the version with Unicode support (file isetup-5.5.5-unicode.exe) or without it (ANSI version - file isetup-5.5.5.exe). To avoid problems with displaying the Cyrillic alphabet, it is better to immediately use the Unicode option Inno Setup.

If you are going to encrypt your future distribution, then you need to download the encryption module ISCrypt.dll separately in the Encryption Module section, see the picture (below you see a link to the source codes of this module - ISCrypt.zip).

On the same page in the QuickStart Pack section you can find a link to the distribution kits ispack-5.5.5.exe and ispack-5.5.5-unicode.exe for installing Inno Setup along with Inno Script Studio, see the picture. Inno Script Studio is a third-party development (Kymoto Solutions) that offers you its user-friendly interface and the ability to debug your installer at runtime. Also, this distribution will offer to download and install the ISCrypt.dll encryption module automatically.

In addition to all of the above, on the download page there are sections Beta Release, for downloading beta versions of Inno Setup, and for downloading source codes, which I will not focus on.

If you are going to use more advanced Inno Setup script editors, then you will also be interested in the Inno Setup Third-Party Files page with a list of third-party developments. Here are the third-party developments we can use in conjunction with Inno Setup:

      • Inno Script Studio - user interface and debugger. Installed using the QuickStart Pack distribution (see above) or a separate distribution that you can download from the developer’s website. There is Russification.

      • Visual & Installer is a paid plugin for Visual Studio (Visual Studio 2005, 2008, 2010, 2012 and 2013 are supported) for creating distributions using Inno Setup. Visual & Installer also contains a Graphical Installer Wizard, which allows you to create thematically designed distributions (see examples).

    • Inno Download Plugin – library and script Inno Setup, which makes it possible to download files during the installation of your distribution. There is support for the Russian language. FTP, HTTP and HTTPS protocols are supported.

      • InnoTools Downloader is another option, similar to Inno Download Plugin, also for downloading files during installation. But there is no localization here, and only FTP and HTTP are supported.
      • VCL Styles for Inno Setup / ISSkin / Graphical Installer (the latter tool is paid) - tools for changing the design of the installation wizard of your distribution.

      • InnoScript - Automatically creates an Inno Setup script file (.iss) from a Visual Basic project file (.vbp or .vbproj). There is Russification.

      • – creates a distribution kit for a Visual Basic project from the Visual Basic 6.0 development environment.

      • – allows you to use a Delphi project file (.dpr) or a Delphi library project file (.dpk) to create a list of dependencies necessary to create a distribution. This utility refused to work for me with the Delphi XE3 project.
      • Inno Setup Script #Includes - a library of functions that you can use during installation. The list of functions can be viewed.
      • Inno Setup Easy Translator is an editor for Inno Setup language files (.isl). This site has been down since 2013, but there is no need to worry because you can easily create and edit language files in any text editor.
      • UninsHs is an extension that allows you to add Repair/Modify/Remove support to your applications.

Also in this list, for some reason, there are still some well-known developments (list updated 04/13/2015):

      • – user interface for working with the Inno Setup script. This program is very similar to Inno Script Studio. If you search, you can find Russification, see picture.

      • InnoIDE is another user interface for working with the Inno Setup script. The InnoIDE website ceased to exist around August 2012 (www.innoide.org), so there is no point in using this development. But the archive of the site has been preserved, which can be viewed. You can also download the distribution there. Russification for InnoIDE can be found on the Internet.

      • InnoSetup Script Joiner is a utility that combines several Inno Setup scripts into one.
      • (Inno Setup Unpacker) - unpacker of distributions created using Inno Setup. Console application.
      • InnoExtractor is another unpacker, but it has a user interface. There is Russification. It worked perfectly with my encrypted test distribution (see picture). As you can see, it gets absolutely all the files, including the files used by the installer, and even the Inno Setup script file.

Actually, after you have decided on the necessary functionality, you can begin the installation. Here I will only look at installing Inno Setup + Inno Script Studio using the QuickStart Pack (file ispack-5.5.5-unicode.exe). Although there is no point in describing all the steps in detail, I will focus only on a few. The “Download and install Inno Script Studio" checkbox should be checked if you want to install Inno Script Studio, the "Install Inno Setup Preprocessor" checkbox - to install the preprocessor, the "Download and install encryption support" checkbox - to install the ISCrypt.dll module to encrypt the distribution. .

First launch of Inno Setup Compiler

The only window of the Inno Setup program is the compiler window. The compiler is launched from the Start menu. When you first launch it, you will see a prompt asking you to create an empty script, run the Create Script Wizard, or open examples or recently used files.

If you have no experience with Inno Setup, then examples will come in handy. Let's open an example, click the "OK" button and select one of the examples. After the example has opened, you can evaluate what a simple Inno Setup script looks like. Also note that the compiler interface is very simple and you will need to write the entire script manually. You will only have reference and examples at your disposal here.

Using the Wizard to Create an Inno Setup Script

You can create a new Inno Setup script from scratch or you can use the Script Wizard. For example, I will make a distribution kit for installing the program MyProg.exe, which is located in the folder with examples (installed with Inno Setup). When launched, the program displays two windows and exits.

To open the script creation wizard window, click on the menu item “File -> New" Or in the welcome window, select the option "Create a new script file using the Scrip Wizard" and click "OK". The first screen of the wizard will be a welcome message. Click here "Next >".

On the second screen, enter the Application name, Application version, Application publisher, and Application website. Required fields are marked in bold in the wizard, while the rest can be left blank.

In the next step, you select a folder for your application. By default, as you can see from the picture, this is a folder with the same name as the application name, and it will be created inside the Program Files folder. The “Allow user to change the application folder” checkbox will allow the user to change the folder during the installation process. And when you check the “The Application doesn’t need a folder” checkbox, the application folder will not be created at all.

If you select “(Custom)” from the “Application destination base folder” drop-down list, then in the field just below you can set an arbitrary path. For example, in order for your application folder to be on the system drive, you need to specify “(sd)”.

As you can see, to indicate the system drive, I specified “(sd)” instead of “C:”, because the system drive may be different on different computers. In general, in Inno Setup you will use constants like “(sd)” very often. All constants are surrounded by curly braces and there are a lot of them. Here is a complete list of constants with a brief description (for a full description, see the "Constants" section in the help):

Directory constants:

      • (app) – application directory, for example, “C:\Porgram Files\My Program”.
      • (win) – Windows directory, for example, “C:\WINDOWS”.
      • (sys) – System32 directory, for example, “C:\WINDOWS\SYSTEM”.
      • (src) – the directory in which the distribution files are located (this is a temporary folder with unpacked distribution files).
      • (sd) – system drive, for example, “C:”.
      • (pf) – application directory, for example, “C:\Program Files (x86)” (in 64-bit mode, this will be the folder for 64-bit applications). In 32-bit mode this constant is equivalent to the constant (pf32) , and in 64-bit mode it is equivalent to (pf64) .
      • (cf) – common files folder, for example, “C:\Program Files (x86)\Common Files”. In 32-bit mode this constant is equivalent to the constant (cf32) , and in 64-bit mode it is equivalent to (cf64) .
      • (tmp) – temporary folder used during installation or uninstallation (the folder name will be in the format “C:\WINDOWS\TEMP\IS-xxxxx.tmp”).
      • (fonts) – fonts folder.
      • (dotnet11) – .NET Framework 1.0 root folder.
      • (dotnet20) – .NET Framework 2.0 root folder. In 32-bit mode this constant is equivalent to the constant (dotnet2032) , and in 64-bit mode it is equivalent to (dotnet2064) .
      • (dotnet40) – .NET Framework 4.0 root folder. In 32-bit mode this constant is equivalent to the constant (dotnet4032) , and in 64-bit mode it is equivalent to (dotnet4064) .

Environment folder constants:

      • (group) – path to the Start menu folder, accessible to all users.
      • (localappdata) – path to the local (without roaming) Application Data folder.
      • (sendto) – path to the user’s Send To folder.
      • (userappdata) and (commonappdata) – path to the Application Data folder.
      • (usercf) – path to the user’s Common Files folder (works only for Windows 7 and later versions; for older versions of Windows this constant will be equal to (localappdata)\Programs\Common).
      • (userdesktop) and (commondesktop) * - path to the desktop folder.
      • (userdocs) and (commondocs) – path to the My Documents folder.
      • (userfavorites) and (commonfavorites) * - path to the Favorites folder.
      • (userpf) – path to the user’s Program Files folder (works only for Windows 7 and later versions; for older versions of Windows this constant will be equal to (localappdata)\Programs).
      • (userprograms) and (commonprograms) * - path to the “All Programs” folder in the “Start” menu.
      • (userstartmenu) and (commonstartmenu) * - path to the top level of the Start menu.
      • (userstartup) and (commonstartup) * - path to the Startup folder in the Start menu.
      • (usertemplates) and (commontemplates) * - path to the “Templates” folder.

* = "common" constants are equal to "user" constants if the user lacks administrative privileges or the PrivilegesRequired statement is set to lowest.

Other constants:

      • (\) – used in cases where you need to install a slash at the end of the path, for example, (app)(\). Otherwise, Inno Setup will remove the last slash.
      • (%NAME|DefaultValue) – the value of the environment variable, where NAME is the name of the variable, DefaultValue is the string to be used if the variable does not exist. DefaultValue – optional. Examples: (%COMSPEC) or (%PROMPT|$P$G). If the line uses the characters “,”, “|”, “)” or “%”, then instead of them you need to write “%2c”, “%7c”, “%7d” and “%25”, respectively.
      • (cmd) – the full path to the console, for example, Windows\System32\cmd.exe (the COMSPEC environment variable is not used to expand this constant).
      • (computername) – the name of the computer on which installation or uninstallation is performed (the value returned by the GetComputerName function).
      • (drive:Path) – Gets the drive letter followed by a colon from an arbitrary path. If a UNC path is specified, it returns the server and folder, for example, \\SERVER\SHARE. Here too, to write the characters “,”, “|”, “)” or “%”, you need to write “%2c”, “%7c”, “%7d” and “%25”, respectively. Here are examples: (drive:(src)), (drive:c:\path\file) or (drive:\\server\share\path\file).
      • (groupname) – the name of the folder in the Start menu for your menu items that the user selected during installation. Unlike the constant (group), it returns only the name, not the full path.
      • (hwnd) – identifier of the installer background window.
      • (wizardhwnd) – identifier of the installer wizard window or 0 if the identifier is not available.
      • (ini:Filename,Section,Key|DefaultValue) – value from the INI file, where Filename is the name of the INI file, Section is the name of the section in the INI file, Key is the name of the key in the INI file, DefaultValue is the string you need use if the specified key is not found. Here too, to write the characters “,”, “|”, “)” or “%”, you need to write “%2c”, “%7c”, “%7d” and “%25”, respectively. Example: (ini:(win)\MyProg.ini,Settings,Path|(pf)\My Program).
      • (language) – internal name of the selected language.
      • (cm:MessageName) and (cm:MessageName,Arguments) – message in the current language, where MessageName – message name, Arguments – arguments for the message, separated by commas. Here too, to write the characters “,”, “|”, “)” or “%”, you need to write “%2c”, “%7c”, “%7d” and “%25”, respectively. Example: (cm:LaunchProgram,Inno Setup).
      • (reg:HKxx\SubkeyName,ValueName|DefaultValue) – a string from the registry, where HKxx is the root registry key, SubkeyName – the path to the desired key, ValueName – the name of the value (or empty if you need to read the default value for the key), DefaultValue – the string to use if there is no specified value or the value is not a string (REG_SZ or REG_EXPAND_SZ). Here too, to write the characters “,”, “|”, “)” or “%”, you need to write “%2c”, “%7c”, “%7d” and “%25”, respectively. Example: (reg:HKLM\Software\My Program,Path|(pf)\My Program).
      • (param:ParamName|DefaultValue) – parameter passed to the installer on the command line, where ParamName is the name of the parameter, DefaultValue is the string to be used if the specified parameter is not found. Here, to write the characters “,”, “|”, “)” or “%”, you need to write “%2c”, “%7c”, “%7d” and “%25”, respectively. Example: (param:Path|(pf)\My Program).
      • (srcexe) – full path to the installer, for example, C:\SETUP.EXE.
      • (uninstallexe) – full path to the uninstaller created by the installer, for example, C:\Program Files\My Program\unins000.exe. This constant is typically used to create a shortcut for uninstalling a program in the Inoo Setup script section. The constant is only valid if the Uninstallable statement is set to yes.
      • (sysuserinfoname), (sysuserinfoorg) – the name and organization, respectively, under which Windows is registered. This information is read from the registry.
      • (userinfoname) , (userinfoorg) , (userinfoserial) – the name, organization and serial number, respectively, specified by the user on the “User Information” page in the installer wizard (which can be enabled using the UserInfoPage instruction). Typically this information is used to write to the registry or INI for later use.
      • (username) – the name of the user who launched the installer or uninstaller (the GetUserName function is used).
      • (log) – name of the log file or an empty string if logging is not enabled.

The next step in the Inno Setup Script Wizard allows you to add your application files.

In the topmost field, the main executable file is selected. If you check the box “Allow user to start the application after Setup has finished”, then the user will see a proposal to start the application after installation. If your distribution does not have an executable file, then you can check the box “The application doesn’t have a main executable file”. Below is a list of files for your distribution. Here you can add individual files (the "Add file(s)..." button) or entire folders (the "Add folder..." button). When you add a folder, you will see an additional question whether to include subfolders or not.

After adding folders and files to the list, you will be able to edit each item ("Edit..." button) or delete it ("Remove" button). In the editing window, you can change many parameters: whether you need to recursively include subfolders (checkbox " Recurse subfolders"), whether you need to include empty folders ( checkbox " Include empty subfolders"), the destination base folder (fields " Destination base folder") and the folder inside base destination folder (“Destination subfolder”).

We will only add a help file as an example.

The next step of the wizard is to select the icons to be created. In the “Application Start Menu folder name” field, set the name of the group in the “Start” menu. If you check the box “Allow user to change the Start Menu folder name”, then the user will be able to change the name of the folder during installation, and if you check the box “Allow user to disable Start Menu folder creation”, then the user will be able to disable the creation of this folder altogether in the Start menu. Check the box “Create an Internet shortcut in the Start Menu folder” and “Create an Uninstall icon in the Start Menu folder” so that the installer creates shortcuts within the group, respectively, for opening your site and for uninstalling your application. The “Allow user to create a desktop icon” and “Allow user to create a Quick Launch icon” checkboxes will allow the user to create shortcuts on the desktop and in the Quick Launch group. I'll check all the boxes.

The next step is to set up the license files and information files that will be shown before and after installation. If you specified a license file, then during installation the user will have to agree to the license. .txt and .rtf files are supported. I will specify the license.txt and Readme.txt files from the examples folder.

In the next step, select supported languages. I'll leave English and add Russian.

The next step is to set the parameters for the Inno Setup compiler. In the “Custom compiler output folder” field, specify the path to the folder in which the Inno Setup compiler will save the created distribution. If this field is empty, the distribution will be created in the same folder as the .iss file. The “Compiler output base file name” field specifies the base name for the distribution file or files. For example, if you set the name to "setup", then when you create a distribution consisting of one file, you will receive the file setup.exe. In the “Custom Setup icon file” field, you can specify the name of the icon file for the future distribution. If nothing is specified here, the standard icon will be used. In the last field “Setup Password” you can specify the password that the user will have to specify during installation. If the “Use the password to encrypt the application files” checkbox is checked, then the files in the distribution will be encrypted using the specified password. For example, I will fill out all the fields in my own way.

The next step notifies you that the Inno Setup preprocessor has been detected and prompts you to use #defines to simplify your script. If you want to use the #define directive, leave the “Yes, use #define compiler directives” checkbox. If the checkbox is not checked, then, in the future, you can add #define directives to your script manually.

And finally the last step has appeared, where we simply click on the “Finish” button.

After this, the compiler immediately wants to compile our script. Let's agree and click the "Yes" button.

After this, the compiler will warn us that the script has not been saved and will offer to do so.

Let's agree (click "Yes") and save the script. After saving, the script was compiled and the finished distribution, in the example this is the file my-setup.exe, was created in the folder that I specified in the wizard at the “Compiler Settings” step. After compilation, you can see how it went in the “ Compiler Output" panel at the bottom of the compiler window, see the picture.

As you can see, everything is simple. Now let’s immediately test the finished distribution. Click on the menu item “Run -> Run” to start installing the program.

After creating the script template, you can start adding various advanced actions.

Debugging a distribution in Inno Setup

To debug your distribution, open the .iss script and click on the menu item “Run -> Run” to start the installation of the program. After this, you will be able to monitor internal processes during installation in the “ Debug Output” window, you will be able to set breakpoints on the necessary lines, see the picture.

To check the value of a constant during debugging, click on the menu item “Run -> Evaluate Constant...” and in the dialog that appears, specify the name of the constant (see picture) and click “OK”.

After this, the following window will appear with the result returned by the constant.

To debug the uninstallation, click on the menu item “Run -> Target Uninstall”, and then “Run -> Run”. And to return back to the installation, click on the item “Run -> Target Setup".

Inno Setup script structure

Scripts in Inno Setup are divided into sections. The name of each section is enclosed in square brackets. Each section contains elements specific to that section. For convenience, you can create several sections with the same name. Such sections will be perceived as one. Here's an example:

[ Setup ] AppName = My Program [ Files ] Source : "MYPROG.EXE" ; DestDir: "(app)"

You can comment lines so that the compiler ignores them by prefixing them with a semicolon.

The script supports the C-like #include directive, which forces the compiler to pull lines from the specified arbitrary text file into the place where this directive appears. Here's the syntax:

#include "filename.txt"

With the #preproc directive you can specify which preprocessor to use: the built-in preprocessor, which supports only the #include directive, or the Inno Setup Preprocessor (ISPP), which supports a very large number of directives and functions. By default, scripts use the ISPP preprocessor if it is installed, and .isl files use the built-in preprocessor. Here's the syntax:

#preproc builtin #preproc ispp

Inno Setup script sections

I will provide here a complete list of all sections of Inno Setup with a brief description. A complete description of sections and a list of section elements can be found in the help in the “Setup Script Sections” section.

– this section contains global settings used during installation and uninstallation. Example:

[ Setup ] AppName =My Program AppVersion =1.5 DefaultDirName =( pf ) \My Program DefaultGroupName =My Program

– an optional section that defines installation options (Full/Compact/Custom), which will be displayed on the page for selecting components for installation. Example:

[Types] Name: "full"; Description : "Full installation" Name : "compact" ; Description : "Compact installation" Name : "custom" ; Description : "Custom installation" ; Flags: iscustom

– an optional section that defines the components that will be displayed on the page for selecting components for installation. Example:

[ Components ] Name : "main" ; Description : "Main Files" ; Types: full compact custom; Flags: fixed Name: "help"; Description : "Help Files" ; Types : full Name : "help\english" ; Description : "English" ; Types : full Name : "help\dutch" ; Description : "Dutch" ; Types: full

– an optional section for creating additional tasks to be performed during installation. The user will see tasks in the form of switches and will be able to choose whether to perform one or another task or not. Example:

[Tasks] Name: desktopicon; Description : "Create a &desktop icon" ; GroupDescription : "Additional icons:" ; Components : main Name : desktopicon\common; Description : "For all users" ; GroupDescription : "Additional icons:" ; Components: main; Flags : exclusive Name : desktopicon\user; Description : "For the current user only" ; GroupDescription : "Additional icons:" ; Components: main; Flags : exclusive unchecked Name : quicklaunchicon; Description : "Create a &Quick Launch icon" ; GroupDescription : "Additional icons:" ; Components: main; Flags : unchecked Name : associate; Description : "&Associate files" ; GroupDescription : "Other tasks:" ; Flags: unchecked

– this optional section determines what additional folders, besides the application folder, need to be created.

[ Dirs ] Name : "(app)\data" Name : "(app)\bin"

– an optional section that determines which files will be installed on the computer.

[Files] Source: "CTL3DV2.DLL"; DestDir: "(sys)" ; Flags : onlyifdoesntexist uninsneveruninstall Source : "MYPROG.EXE" ; DestDir : "(app)" Source : "MYPROG.CHM" ; DestDir : "(app)" Source : "README.TXT" ; DestDir: "(app)" ; Flags: isreadme

– an optional section that determines what shortcuts will be created in the Start menu, on the desktop, etc.

[ Icons ] Name : "(group)\My Program" ; Filename: "(app)\MYPROG.EXE" ; WorkingDir : "(app)" Name : "(group)\Uninstall My Program" ; Filename: "(uninstallexe)"

– an optional section that determines which entries will be added to the INI file.

[INI] Filename: "MyProg.ini"; Section : "InstallSettings" ; Flags : uninsdeletesection Filename : "MyProg.ini" ; Section : "InstallSettings" ; Key : "InstallPath" ; String: "(app)"

and - these optional sections determine which files or folders need to be removed, respectively, upon first installation or uninstallation. Example:

[UninstallDelete] Type: files; Name : "(win)\MYPROG.INI"

– the section defines the languages ​​that will be available during installation. When you run the installer, a language will be selected that matches the system language. Otherwise, the language located first in the section will be used by default. Example:

[Languages] Name: "en"; MessagesFile : "compiler:Default.isl" Name : "nl" ; MessagesFile : "compiler:Languages\Dutch.isl"

– section for replacing messages described in language .isl files. An example of replacing the standard text “&Next >” on a button to go to the next step for English only:

[ Messages ] en.ButtonNext =&Forward >

– section for defining the values ​​of the constant (cm:...), see the description of the constants above. Usage example:

[ CustomMessages] CreateDesktopIcon=Create a &desktop icon [ Tasks ] Name : desktopicon; Description : "(cm:CreateDesktopIcon)"

– section contains language settings, such as font. Example:

[ LangOptions ] LanguageName=English LanguageID=$0409 LanguageCodePage=0 DialogFontName= DialogFontSize=8 WelcomeFontName=Verdana WelcomeFontSize=12 TitleFontName=Arial TitleFontSize=29 CopyrightFontName=Arial CopyrightFontSize=8 RightToLeft=no

– This optional section determines which keys and values ​​need to be created, modified, or deleted in the registry. Examples of using:

[Registry] Root: HKCU; Subkey : "Software\My Company" ; Flags: uninsdeletekeyifempty Root: HKCU; Subkey: ; Flags: uninsdeletekey Root: HKLM; Subkey : "Software\My Company" ; Flags: uninsdeletekeyifempty Root: HKLM; Subkey : "Software\My Company\My Program" ; Flags: uninsdeletekey Root: HKLM; Subkey : "Software\My Company\My Program\Settings" ; ValueType: string; ValueName : "InstallPath" ; ValueData: "(app)"

– this optional section determines which programs need to be executed after successful installation, but before the final step appears in the installation wizard window. Examples:

[ Run ] Filename : "(app)\INIT.EXE" ; Parameters : "/x" Filename : "(app)\README.TXT" ; Description : "View the README file" ; Flags : postinstall shellexec skipifsilent Filename : "(app)\MYPROG.EXE" ; Description : "Launch application" ; Flags : postinstall nowait skipifsilent unchecked

– this optional section determines which programs need to be executed at the very beginning of the uninstallation.

– in this optional section you can place your Pascal script. The RemObjects Pascal Script engine is used to process the Pascal script. This engine is as free as Inno Setup. Official page of the RemObjects Pascal Script engine - . Examples of usage can be found in the files "Code*.iss" and "UninstallCode*.iss" in the "Examples" folder in the Inno Setup installation location.

Installation and uninstallation procedure

A very important point during installation is understanding the order in which the script is executed. The installer steps are listed below in the order in which they will be performed during installation:

      • Section execution.
      • Section elements are saved in the uninstallation log (which, at this stage, is stored in memory).
      • An application directory is created if necessary.
      • Sections are running.
      • The name of the uninstallation log file is reserved, if necessary.
      • The section is running (files are not being registered yet).
      • Section is running.
      • Section is running.
      • Section is running.
      • Files that should be logged are logged unless the system has to be rebooted. In cases where a reboot is required, registration occurs only after the system is restarted.
      • Add to the list of installed programs (Control Panel\Programs\Programs and Features), if necessary.
      • Section elements are saved in the uninstallation log.
      • The EXE file and the uninstaller log are saved to disk. After this point, the user is prohibited from canceling the installation, and any subsequent errors will not result in the installation being rolled back.
      • Execute section, except for section elements with the “postinstall” flag set, which will be executed after the last step of the installation wizard is displayed.
      • Update associations for files if the "ChangesAssociations" flag is set to "yes".
      • Notifies running applications that environment variables have changed if the ChangesEnvironment flag is set to yes.
      • As for the section elements, they will be executed in the order in which they are located within the section.

Uninstallation occurs in reverse order. But this does not apply to the and sections, which will be executed in the order in which they appear in the script (not in reverse order).

Preprocessor Inno Setup

I would like to write a few words about the Inno Setup preprocessor (ISPP).

The main purpose of a preprocessor is to automate tasks during compilation and reduce the likelihood of typos in your scripts. For example, you can declare an ISPP (compile-time variable) variable containing the name of your application, and then use the value of that variable in multiple places in your script. If you later need to change the name of your application for some reason, you can do it in one place in your script. Without ISPP, you will have to find and fix all parts of the script where you use the application name, such as AppName, AppVerName, DefaultGroupName, etc.

Another example of using ISPP is to pull application version information from an EXE file and use it in the AppVerName statement in the section. Without ISPP, you will have to change the script every time the application version changes.

In addition, breaking the script into parts makes it possible to create a single script for different versions of your application (for example, trial and full-featured versions).

When using a preprocessor, it is important to remember that the preprocessor only works at compile time.

Calling the Inno Setup compiler from the command line

It would also be useful to know about the possibility of compiling the distribution from the command line. The compilation call looks like this:

compil32/cc

Here's an example:

compil32 /cc "c:\isetup\samples\my script.iss"

Calling compilation from the command line, in this case, does not hide the display of progress or error messages. The compiler returns 0 if compilation was successful, 1 if the command line parameters were passed incorrectly, or 2 if compilation failed.

An alternative compilation method is to use the console compiler ISCC.exe. Here is a diagram of how to use the compiler:

compil32/cc

iscc [options]

iscc "c:\isetup\samples\my script.iss"

Here are the main options:
/DO – disable distribution creation (changes all Output parameters in the script).
/EO – enable distribution creation (changes all Output parameters in the script).
/O – sets the path where the distribution will be created (changes all OutputDir parameters in the script).
/F – sets the distribution file name (changes all OutputBaseFilename parameters in the script).
/Q[p] – for hidden compilation (only error messages are displayed, “p” displays progress).
/?

– to display help.

Here's an example using options:

iscc /Qp /O"My Output" /F"MyProgram-1.0 " /Sbyparam=$p "c:\isetup\samples\my script.iss"

ISCC returns 0 if compilation was successful, 1 if the parameters were incorrect or an internal error occurred, or 2 if compilation failed.

In conclusion about Inno Setup