My Inno Setup Extensions: how to


Welcome to my Inno Setup Extensions 'how to' page. Here you can find more information on how to use My Inno Setup Extensions for Inno Setup. It is assumed that you already know how to work with the Inno Setup compiler and Inno Setup script files.

If you have still have questions after reading this, please don't hesitate to ask them on the Inno Setup newsgroups or e-mail to mlaan@wintax.nl. When posting or e-maling a question about a script that you made, please attach it to your question.

To keep informed about updates please join the My Inno Setup Extensions mailing list.

Note: grayed entries are now part of the official Inno Setup at www.jrsoftware.org. See the Inno Setup help file for updated 'how to' instructions.

(Updated July 7 2000)

Go to [ Wizard styles | Setup types | Silent (un)install, auto update | 'Run/Create Icon checkboxes' | Misc. ]
 
Wizard styles

In short: to select a wizard style go to your [Setup] section and
-Enter 'WizardStyle=classic' to use the 'classic' wizard style.
-Enter 'WizardStyle=modern' to use the 'modern' wizard style.

[Setup]

The following is a list of new directives:

WizardStyle
Valid values: modern or classic
Default value: modern
Description:
If this is set to modern, Setup will use the 'modern' wizard style which is also used by Windows 2000, Windows Installer and other modern installation builders. If this is set to classic, Setup will display the 'classic' wizard style which is also used by official Inno Setup, older versions of My Inno Setup Extensions and other 'old' installation builders.

UninstallStyle
Valid values:
modern or classic
Default value: modern (modern style wizard), classic (classic style wizard)
Description:
If this is set to modern, Setup will use the 'modern' uninstaller style which looks exactly like the 'modern' wizard style. If this is set to classic, Setup will display the 'classic' uninstaller style which is used by official Inno Setup.

WizardSmallImageFile
Default value: 'compiler:WIZMODERNSMALLIMAGE.BMP'
Description:
Name of the bitmap file to display in the upperright corner of the 'modern' wizard window. Should be 55 x 55 pixels.
Remarks: not used by the 'classic' wizard

Remarks:
-The default WizardImageFile is 'compiler:WIZMODERNIMAGE.BMP' for the 'modern' wizard style and 'compiler:WIZCLASSICIMAGE.BMP' for the 'classic' style. For the 'modern' wizard style the image should be 164 x 313 pixels.
-The default WizardImageBackColor is '$400000' for the 'modern' wizard style and 'clTeal' for the 'classic' style.
-By default the 'modern' wizard will not display the background window (the window with the gradient). Use the WindowVisible directive to turn it back on if you really really want to, but
remember that it's non standard for modern wizard style installers by MS and others.
-Like the 'classic' style uninstaller dialog, the new 'modern' style uninstaller dialog is a Windows dialog and doesn't use the VCL to keep the uninstaller small.

[Messages]

DefaultIsx.isl contains the following new messages concerning the 'modern' wizard style:

-WelcomeLabel1=Welcome to the [name] setup program.
-WelcomeLabel2=This will install [name/ver] on your computer.%n%nIt is strongly recommended that you close all other applications you have running before continuing. This will help prevent any conflicts during the installation process.
-PasswordLabel1=This installation is password protected.
-PasswordLabel2=Please provide the password. Passwords are case-sensitive.
-LicenseLabel=Please read the following important information before continuing.

-; _WelcomeFont=Arial,12
-ClickNextModern=Click Next to continue, or Cancel to exit Setup.
-WizardInstalling=Setup Status
-InstallingLabel=Please wait while Setup is installing [name] on your computer.
-WizardUninstalling=Uninstall Status
-StatusUninstalling=Uninstalling %1...

 

Setup types

[Setup]

The following is a list of new directives:

UsePreviousSetupType
Valid values: yes or no
Default value: yes
Description:
When this directive is yes, the default, at startup Setup will look in the registry to see if the same application is already installed, and if so, it will use the setup type and components settings from the previous installation as the default settings presented to the user in the wizard.

AlwaysShowComponentsList
Valid values: yes or no
Default value: yes.
Description:
If this directive is set to yes, Setup will always show the components list for customizable setups. If this is set to no Setup will only show the components list if the user selected a custom type from the type list.

FlatComponentsList
Valid values: yes or no
Default value: yes (modern style wizard), no (classic style wizard)
Description:
When this directive is yes, Setup will use 'flat' checkboxes for the components list. Otherwise Setup will use '3d' checkboxes.

ShowComponentSizes
Valid values: yes or no
Default value: yes
Description:
When this directive is yes, Setup will show the size of a component in the components list.
Note:
Depending on the largest component, Setup will display sizes in kilobytes or in megabytes.

DisableReadyMemo
Valid values: yes or no
Default value: no
Description:
If this is set to yes, Setup won't display a settings memo on the Ready To Install Page. Otherwise the memo is shown and contains information like the chosen setup type and the chosen components.

[Types]

This new section is optional. It defines all of the setup types Setup will show during installation.

Here is an example of a [Types] section:

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

The following is a list of the supported parameters: 

Name (required):
The internal name of the type. Used as parameter for components to instruct Setup to which types a component belongs.

Example:
Name: "full"

Description (required):
The description of the type. This description is shown during installation.

Example:
Description: "Full installation"

Flags:
This parameters is a set of extra options. Multiple options may be used by separating them by spaces. The following options are supported: 

iscustom
Instructs setup that the type is a custom type. Whenever the end user manually changes the components selection during installation, Setup will set the setup type to the custom type. Note that if you don't define a custom type, Setup will only allow the user to choose a setup type and he/she can no longer manually select/unselect components.

Common parameters:
MinVersion, OnlyBelowVersion

Remarks:
-During compilation a set of default setup types is created if you define components in a [Components] section but don't define types. These types are the same as the types in the example above.

[Components]

This new section is optional. It defines all of the components Setup will show during installation for setup type customization.

Here is an example of a [Components] section:

[Components]
Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed
Name: "help"; Description: "Help Files"; Types: full

This example generates two components: A "main" component which gets installed if the end user selects a type with name "full", "compact" or "custom" and a "help" component which only get installed if the end user selects the "full" type. Since the "custom" type is customizable the "help" component is also be installed if the user wants to, even though "custom" isn't in the types list of the "help" component.

The following is a list of the supported parameters:

Name (required):
The internal name of the component.

Example:
Name: "help"

Description (required):
The description of the component. This description is shown to the end user during installation.

Example:
Description: "Help Files"

Types:
A space separated list of types this component belongs to. If the end user selects a type from this list, this component will be installed.

Example:
Types: full compact

Flags:
This parameters is a set of extra options. Multiple options may be used by separating them by spaces. The following options are supported: 

fixed
Instructs Setup that this component can not be manually selected or unselected by the end user during installation.

restart
Instructs Setup to ask the user to restart the system if this component is installed, regardless of whether this is necessary (because of [Files] section entries with the restartreplace flag). Like AlwaysRestart but per component.

disablenouninstallwarning
Instructs Setup not to warn the user that this component will not be uninstalled after he/she deselected this component while it's already installed on his/her machine.

Common parameters:
MinVersion, OnlyBelowVersion

Remarks:
-Even if you disable customization because you didn't define a custom type, you can still use this section. Setup won't show the components list on the Select Components page (thereby disabling customization), but it will show the end user the selected components in the settings memo on the Ready To Install page.
-If you don't define components in this section, the Select Components page will be automatically skipped during installation, but the settings memo of the Ready To Install page still is shown.

-Depending on the complexity of your components, you can try to use the [InstallDelete] section and the disablenouninstallwarning flag to automatically 'uninstall' deselected components. See the 'classic' component in the My Inno Setup Extensions sample script for an example.

[Dirs], [Files], [Icons], [INI], [InstallDelete], [Registry], [Run], [UninstallDelete], [UninstallRun]

The following is a list of new parameters for entries in the above sections:

Components:
A space separated list of component names, telling Setup to which components this entry belongs. If the end user select a component from this list, this entry is processed (for example: the file is installed).

Here is a example:

[Files]
Source: "MyProg.exe"; DestDir: "{app}"; Components: main
Source: "MyProg.hlp"; DestDir: "{app}"; Components: help
Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme

[Icons]
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"; Components: main
Name: "{group}\My Program Help"; Filename: "{app}\MyProg.hlp"; Components: help

Remarks:

-A file without a Components parameter is always installed.
-The Components parameters are ignored if the [Components] section is empty.
-The Components parameter also works for displaying readme files. A 'isreadme' file will only be displayed if a component it belongs to is installed. If there are two readme's that should be displayed, Inno Setup (also the official) only displays the first in the script.

[Messages]

DefaultIsx.isl contains the following new messages concerning setup types:

-WizardSelectComponents=Select Components
-SelectComponentsLabel=Select the components you want to install, clear the components you do not want to install:
-FullInstallation=Full installation
-CompactInstallation=Compact installation
-CustomInstallation=Custom installation
-ReadyMemoDir=Destination directory:
-ReadyMemoType=Setup Type:
-ReadyMemoComponents=Selected Components:
-ReadyMemoGroup=Program group:
-NoUninstallWarningTitle=Components Exist
-NoUninstallWarning=Setup has detected that the following components are already installed on your computer:%n%n%1%n%nDeselecting these components will not uninstall them.%n%nWould you like to continue anyway?
-ComponentSize1=%1 KB
-ComponentSize2=%1 MB

Setup now also supports '[kb]' instead of '[mb]' in some messages. For example:

DiskSpaceMBLabel=The program requires at least [kb] KB of disk space.

Silent (un)install, auto update

In short:
  • To create a silent installation you can:
     
    • Set 'InstallMode' under [Setup] to 'Silent' or 'VerySilent'
    • Pass '/Silent' or '/VerySilent' as a command line options and optionally use '/Dir=', '/Group=', '/NoIcons' and '/Components=' to change the parameters from their default values.
    • Create a ini-style file and use the '/LoadInf=' command line option. The file should contain a [Setup] section with keys Silent, VerySilent, Dir, Group, NoIcons, Components and/or SaveInf.
       
  • To have Setup auto update your application use for example:

         setup.exe /SP- /silent /noicons "/dir=c:\Program Files\My Program"

    as the command line and use the skipifsilent and skipifnotsilent flags as shown below.
     
  • To create a silent uninstallation pass '/Silent' as a command line option to the uninstaller. For example:

         unins000.exe /Silent

    There's no 'UninstallMode' directive (yet).

[Setup]

InstallMode
Valid values: normal, silent, or verysilent
Default value: normal
Description:
-Normal instructs setup to use the normal wizard interface
-Silent instructs setup to only display a installation progress dialog, the startup prompt and errors
-VerySilent instructs setup to display the same as for Silent except the progress dialog and the taskbar button.

Installer command line options

/silent
/verysilent
/noicons
/components=component1,component2,...
/loadinf=filename
/saveinf=filename

Remarks:
-The /silent and /verysilent command line options override the InstallMode directive
-Command line options '/dir=dirname' and '/group=groupname' already exist
-The components list is comma seperated and not space seperated as in a script.
-All options are checked in the above order, so if you have a non silent setup and start it with '/Silent' it becomes silent.
-When a setup is silent the wizard and the background window are not displayed but the 'installation progress' window is. When a setup is very silent this installation progress window is not displayed. Everything else is normal so for example error messages during installation are displayed and the startup prompt is (if you haven't disabled it with DisableStartupPrompt or the '/SP-' command line option)
-If a restart is necessary a Silent install will display a 'Reboot now?' messagebox. A VerySilent install will reboot without asking
-The files used with /LoadInf and /SaveInf should be ini-style files with a [Setup] section. Here is an example:

[Setup]
Silent=1
Components=main,help

To create such a file you can use the /SaveInf option. Start Setup with a '/SaveInf=filename' command line parameter (don't forget to use quotes if the filename contains spaces) and use the wizard to install the application. After the installation has completed a file with the options that were selected using the wizard is saved with the specified name.

[Run]

The following is a list of new flags for entries in the [Run] section. Here is an example:

[Run]
Filename: "{app}\MyProg.exe"; Description: "Run My Program"; Flags: nowait showcheckbox skipifsilent
Filename: "{app}\MyProg.exe"; Parameters: "/updated"; Flags: nowait skipifnotsilent

Flags:

skipifsilent
Instructs Setup to skip this entry if Setup is running (very) silent.

skipifnotsilent
Instructs Setup to skip this entry if Setup is not running (very) silent.

Auto update

To easily auto update your application, first make your application somehow detect a new version of your setup.exe and make it locate or download this new version. Then, to auto update, start your setup.exe from your application with for example the following commandline:

/SP- /silent /noicons "/dir=c:\Program Files\My Program"

After starting setup.exe, exit your application as soon as possible. Note that Setup now has a auto retry feature to avoid problems with updating your .exe.

Optionally you could also use the new skipifsilent and skipifnotsilent flags and make your application aware of a '/updated' parameter to for example show a nice messagebox to inform the user that the update has completed. See above for an example.

Uninstaller commandline options

/silent

[Messages]

DefaultIsx.isl contains the following new messages concerning silent install:

FinishedRestartMessage=To complete the installation of [name], Setup must restart your computer.%n%nWould you like to restart now?

'Run/Create icon checkboxes'

Support for 'run checkboxes' and 'create icon checkboxes' (checkboxes on the Setup Completed page) is accomplished using one new optional parameter and two new optional flags for the [Run] and [Icons] section. The isreadme flag for entries in the [Files] section is now obsolete but can still be used (see the remarks below).

Here is an example:

[Run]
Filename: "{app}\Readme.txt"; Description: "View the README file"; Flags: shellexec showcheckbox
Filename: "{app}\MyProg.exe"; Description: "Launch application"; Flags: nowait showcheckbox unchecked

[Icons]
Name: "{userdesktop}\MyProg"; Filename: "{app}\MyProg.exe"; Description: "Create a desktop icon"; Flags: showcheckbox

[Run], [Icons]

The following is a list of new parameters flags for entries in the [Run] or [Icons] section.

Description: (Required for [Icons] entries)
The description of the entry. This description is used run entries with the showcheckbox flag. If the description is not specified for a run entry, Setup will use a default description. This description depends on the type of the run entry (normal or shellexec).

Flags:

showcheckbox
Instructs Setup to create a checkbox on the Setup Completed page. The user can uncheck or check this checkbox and thereby choose whether this entry should be processed or not.

unchecked
Instructs Setup to initially uncheck the checkbox. The user can still check the checkbox if he/she wishes to process the entry.

Remarks:

-Entries that don't have a showcheckbox flag are treated as normal entries and are automatically processed after the installation of all files and before the Setup Completed page is displayed (like official Inno Setup).
-The Components parameter of a entry also works for entries with a checkbox.
-The isreadme flags for entries in the [Files] section is now obsolete. If the compiler detects a entry with a isreadme flag, it strips the isreadme flag from the file entry and inserts a generated run entry at the head of the list of run entries. This generated run entry runs the readme file and has flags shellexec, skipifdoesntexist, showcheckbox and skipifsilent.
-None of these new parameters/flags can be used in the [UninstallRun] section.
-For technical reasons Setup always tries to uninstall a icon during uninstallation, even if the icon wasn't created during installation because the user unchecked the checkbox. Also on NT 3.51 the 'create icon checkboxes' won't be displayed.

[Messages]

DefaultIsx.isl contains the following new messages concerning 'run checkboxes':

-RunEntryExec=Run %1
-RunEntryShellExec=View %1

 

Misc.

[Setup]

You can now optionally use rich text files (.rtf) for LicenseFile, InfoBeforeFile and InfoAfterFile. You don't have to do anything special, just use a .rtf file and it will work.

Here is an example:

[Setup]
InfoBeforeFile=infobefore.rtf

Remarks:
-Setup now automatically detects the availability of Rich Edit 2.0 or 3.0 on the end users system and activates 'auto url detection' if Rich Edit 2.0 or 3.0 is found. This means that your .txt or .rtf InfoBeforeFile, InfoAfterFile or LicenseFile can now contain clickable links. For example: if you put 'http://www.wintax.nl/isx' in your text the user can click on it to go to the ISX site. Similar if you put 'mailto:mlaan@wintax.nl' in your text, the user can click it to send mail. Try the ISX 1.3.11 installer to see it in action.
-The compiler no longer enforces a 32 kb limit for InfoBeforeFile, InfoAfterFile and LicenseFile from the compiler and Setup now supports larger files (> 2 gb).

[Run]

The following is a list of new flags for entries in the [Run] section. Here is an example:

[Run]
Filename: "{win}\Media\Start.wav"; Flags: shellexec skipifdoesntexist

Flags:

skipifdoesntexist
Instructs Setup not to generate an error messagebox if the run entry doesn't exist.

[Messages]

DefaultIsx.isl contains the following new messages:

-BeveledLabel=

Remarks:
-The BeveledLabel message is used to instruct Setup to display a beveled (grayed) label on the left side of the bottom bevel displayed by 'classic' or 'modern' installers and by 'modern' uninstallers.

 

 

Martijn Laan, Aalsmeer, The Netherlands, mlaan@wintax.nl