Inno setup examples. Creating a program installation distribution

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 refer to the step-by-step setup wizard of Inno Script Studio. 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.


InstallShield provides an environment for setting up a project, creating a script, and ultimately releasing a distribution - both in MSI and various virtual formats. This is one of the most famous solutions in the field of creating installers for the Windows platform. There are three editions of the complex - Express, Professional and Premier. The last of them is considered the most functional (see). Not long ago, an updated InstallShield 2014 package was released, which will be discussed further.

Projects can be imported from Microsoft Visual Studio or created from existing templates. When creating a project from scratch, you can choose from several types:

  • Basic MSI project - Windows Installer technology is used, calling InstallScript, VBScript, Jscript scripts, exe and dll files is available.
  • InstallScript Project - InstallScript is used to control installation
  • InstallScript MSI project - combines Windows Installer and InstallScript to deploy an installation.

In turn, for each of these types there are many additional projects. In general, in addition to installers, the complex allows you to create association modules (Redistributable), as well as modifiers (Transform).

There are several options for getting started with InstallShield, one of them is to use the step-by-step setup wizard (Project Assistant), which starts automatically when you create a new project. More detailed configuration is carried out in the installation designer window. The settings are grouped as follows:

  • Installation Information - a table with general information about the project. Here, in particular, you can select the default installer language. In total, InstallShield supports more than 30 localizations.
  • Organization - Includes the installer design, a list of features and components that will be presented to the user to choose from during installation.
  • Application Data - Application data such as files, modules, and dependencies. Some components can be installed locally, others must be downloaded during installation.
  • System Configuration: shortcuts, resources, configuration files, services, etc.
  • Server Configuration - server configuration in accordance with the installer's requirements. This includes IIS settings, component services, SQL scripts for SQL Server, Microsoft Windows Azure, MySQL, or Oracle. Using Microsoft Web Deploy, you can download dependencies, run scripts, and perform tasks on the server.
  • Behavior and logic - scripts, actions, files for installation, etc.
  • User Interface - installer design, including dialog design, images, text and other data. Design themes are available to choose from, very flexible customization of existing dialogs, even down to dragging and dropping each element. The line-by-line editor allows you to work with localizations.
  • Media - managing environment variables, setting up product updates and releases, patches.
  • Additional Tools: file dependency scanner, MSI debugger and direct editor designed to view the project structure in table form.

The scripting language for creating installers is InstallScript, which is similar to the C language and allows you to create custom actions (Custom Actions). Thus, scripts help when calling dll libraries, launching applications, VBScript, Jscript, InstallScript scripts and many others. etc.

To edit code in InstallShield, an editor with syntax highlighting and autocompletion is used. In addition, the Custom Action Wizard can be used to create actions.

Summary . Undoubtedly, InstallShield is one of the leading products on the installation complexes market. Its greatest strength is its flexibility, which allows you to create numerous types of installers for deployment on a computer or server, with scripting support. Home use may be deterred by the fairly high license price for each edition, starting with InstallShield Express ($649).

Setup Factory


Indigo Rose Software Design has been producing development products since 1991. Among them are MSI Factory, TrueUpdate, Visual Patch and related solutions. Setup Factory is another complex that allows you to create fully functional scripted installers - but, unlike MSI Factory, independent of MSI. In this case, the resulting distribution can be run under any version of Windows, starting with XP. Alternative distribution options are available - installation from CD or DVD media, web installer with the ability to download dependencies. LZMA/LZMA2 compression formats and files larger than 2 GB are supported.

The Setup Factory installation environment uses a simple, flexible and powerful scripting language based on the LUA language. This allows you to use conditions, functions, variables, tables, and other tools when writing a script.

A traditional step-by-step wizard is provided to create the installer. It consists of the following stages of working with the project: filling in general information about the installer, choosing an architecture, file location, style and theme, installation languages, library composition.

Alternatively, you can go straight to setting up the installer project yourself; a simple editor interface is provided for these tasks. A list of tasks is available in the left column of the application window; it is divided into sections: files, settings, visual options, actions, resources and uninstallation.

Scripts are managed through the Actions section. All actions are divided into several stages, in chronological order: startup, installation process and errors at this stage, completion of installation and shutdown.

To create actions, users are provided with the Action Wizard and Code Wizard add-ons. In total, about 360 scripts are available, and each action is carefully documented in a well-structured help. In parallel with this, the main work with the code is carried out in the editor window. Code highlighting and line numbering are available; you can use the built-in Setup Factory tools to check the script for errors.

The functionality of the installer is expanded due to resources. In the corresponding Resources section, you can specify dependencies (.NET, Visual Basic, DCOM, JET, MDAC, Windows Installer, Visual C++, etc.), install global functions and connect plugins for working with the clipboard, archives, FTP. In addition, additional extensions are posted on the developer forum.

The convenience of the project editor is noticeable when working with localizations: you can not only add an interface language, but also import or export data to XML. Every aspect of the installer is customizable and available in preview mode: dialogs, button labels, text formatting, fonts, and much more. etc. The appearance can be changed using pre-installed themes. Moreover, not only “native” styles are used (Windows 7, Windows 8, etc.), but also various MSStyles modifications, which can be downloaded separately.

Finally, it is worth noting such an aspect of Setup Factory as security. Installation can be restricted using a serial number, all keys are stored in an MD5 hash. During installation, the data security and expiration date of the distribution are checked.

Summary . Setup Factory allows you to use the extensive scripting capabilities of the LUA language. All actions are well documented; the user can use the setup wizard at various stages of work, from creating to publishing the project. The functionality of the installer can be expanded with add-ons. The installer interface is carefully configured and it is convenient to work with localizations.

SetupBuilder

SetupBuilder is a tool for rapid application development and configuration. With its help, you can create scripted installers with a compact kernel of 160 KB in size. These can be web, CD/DVD distributions, running under any Windows OS 9.x and higher. Among the key features of SetupBuilder is certified support for Windows 8 and Windows Server 2012 - which guarantees compatibility and correct installation.

It should be noted that there are two editions of the application to choose from: for developers (Developer) and professional version (Professional). The list of features is significantly between these editions, with the peculiarity that SetupBuilder Developer is more functional. It includes a graphical dialog editor, a debugger, a compiler, an update generator and other components.

When creating a project from scratch, you can use the wizard, but it essentially doesn’t solve much. The Project Editor consists of the following sections: Project Definition, Installation Details, Setup Appearance, Setup Requirements, and Script Logic.

Project Definition - setting up general information, variables, installation profiles. It is worth noting the Web-deployment subsection, where you can activate the web update or web installation functions of the product. Also, one project can include several versions of the application (Releases).

Installation Details - definition of the contents of the installer, including files, folders, registry keys, services, drivers, environment variables and other elements.

Setup Appearance - setting up the appearance. A visual editor is used to define the appearance of the installer - including dialogs, text content, buttons, fields, etc. Other settings, such as localization and installer style, are specified separately in the project settings (Project - Settings).

Setup Requirements - checking dependencies, access rights, system and other files.

Script Logic - access to the installer script. It uses its own IDE to work with scripts, and also has a built-in visual debugger. SetupBuilder uses the SetupScript scripting language, and, in the case of the Developer edition, comes with about 500 pre-installed functions. In addition to using SetupScript, during installation you can access the Windows API or connect the necessary DLLs.

The SetupProtect function, available in SetupBuilder Developer, is responsible for security. It allows you to use serial numbers and subscription keys for a certain period of operation. In addition, a digital signature of the distribution is available.

Summary . SetupBuilder allows you to create installers, web installers and updates using scripts and Windows API capabilities. Among the most notable aspects of this complex are close support for Windows, visual editing and debugging of the project, multilingualism and protection against unauthorized use.

Visual Installer 2014

Visual Installer is a complex for creating Windows installers in visual mode and with script support. The created distributions can be distributed on CD/DVD, USB media and via the Internet, in the form of self-extracting archives.

There are two versions of Visual Installer - standard and professional. In the latter case, the project additionally includes a project manager and SamLogic Selector, a utility for determining system dependencies at startup. In addition, the professional version allows you to work with 64-bit applications and involves working with scripts.

First, Visual Installer prompts you to specify the distribution format of the distribution and set basic settings. Alternatively, you can import existing projects from Visual Studio / Visual Basic environments into the program and continue working based on the existing project.

Further work is carried out directly in the editor. At the bottom there are tabs for navigation between sections. The sections File list, Registry, INI Files and Components define the structure of the installer, including files, directories, registry keys and other components. Separately, we can highlight the visual component. So, when setting up the installation wizard, a selection of dialogs is provided (Dialog Boxes tab): entering the license key, selecting components, license text, etc. The design of the installer is determined in the corresponding Design tab: these are color, background, fonts, images and sound.

Additional installer options are available in the Specials menu section. Here you can specify dependencies (operating system version and .Net Framework), without which installation will not be possible. Installer options such as silent installation, digital signature and password protection are also available.

Visual Installer provides for the creation of multilingual distributions. Managing localizations, compared to other installation systems, is not very convenient: all files are stored in LNG format in an external file that must be edited manually in a text editor.

Scripts available in the Pro version can be used before and after installation. The scripting language allows you to use variables and commands described in the reference book, control the process of creating files, folders, shortcuts, and other components, and launch external MSI and other programs. A simple editor with support for IntelliSense autocompletion is used to edit scripts.

Finally, the following point should be noted: the encoding is displayed incorrectly in the dialogs and not all active buttons work when pressed. This problem occurs in Windows 8.

Summary . A fairly simple and somewhat outdated installation complex, where, nevertheless, scripts and a visual project editor are available. All settings are made on the basis of blanks; the installation order cannot be changed.

Pivot table
ApplicationNSIS (Nullsoft Scriptable Install System)Inno SetupIzPackExcelsior InstallerWiX ToolsetClickteam Install CreatorActual InstallerCreateIntallAdvanced InstallerInstallBuilderInstallMateInstallShieldSetup FactorySetupBuilderVisual Installer
DeveloperNullsoftJordan Russell, Martijn LaanJulien Ponge et al.ExcelsiorMicrosoftClickteamSofteza DevelopmentNovostrimCaphyon LTDBitRockTarma Software ResearchFlexera SoftwareIndigo RoseLindersoftSamLogic
PlatformWindows, POSIXWindowsWindows, Linux, MacOS+WindowsWindowsWindowsWindowsWindowsWindowsWindows, Linux, Mac OS+WindowsWindowsWindowsWindowsWindows
Pricefor freefor freefor freefor freefor free€49.00 / €119.00 (Pro)$89 free (Free) / 2000 rub. (full version)from $399from $995from $89from $649 $395 $299 (Developer) / $169 (Pro) $129
Scripting languageNSISInno Setup Script, PascalJavaWindows InstallerGenteeVBScript, JscriptJava, PHP, Perl, Python, Ruby, C/C++, .NET/MonoVBScript, Jscript, PowerShellInstallScript, PowerShellLUASetupScriptVisual Installer
Installer typeEXEEXEJAREXEMSIEXEEXEEXEEXE, MSI, JAREXEEXE, MSIEXE, MSIEXEEXE, MSIEXE
Project Editor+ (add-ons)+ (add-ons)+ (add-ons)+ + (add-ons)+ + + + + + + + + +
Importing projectsEclipse, IntelliJ IDEA, Netbeans, Apache AntNSISVisual StudioVisual Studio, Eclipse, Visual Basic, etc.Visual Studio, Visual Basic, etc.Visual Studio, Windows Installer, etc.Visual Basic, .NET, Windows Installer, etc..NETVisual Studio, Visual Basic
Multilingual+ + + + + + + + + + + + + +
Compression typesZLib, BZip2, LZMABZip2, LZMA/LZMA2raw, gzip, bzip2, 7-Zip SFXnot indicatedMSZIPzipper/differentiatornot indicatedCAB, 7-ZipLZMALZMALZMA/LZMA2ZlibLZMA/LZMA2LSZipZIP
Serial number/password protection+ + + (Pro)+ + + + + + + +
Selecting components during installation+ + + + + + + + +
"Silent Installation+ + + + + + + + + + + + + +
Command line+ + + + + + + + + + + + + +
Extensions+ + + + + + + + +

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.

When confirmation is complete, 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 that you 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.

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 a 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 displayed 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:

iscc [options]

Here's an example:

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).
/S – setting the SignTool parameter.
/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

It will not be possible to talk about all the possibilities of Inno Setup in one article; this is a very large amount of information, so I have described here only the main points. After reading this, you can start using this amazing tool to create your own distributions. In the future I will talk about alternative user interfaces. Now, write your comments on the article, and I will try to answer all your questions.

mob_info