[Icons] section

Inno Setup

[Icons] section

This optional section defines any shortcuts Setup is to create in the Start Menu and/or other locations, such as the desktop.

Here is an example of an [Icons] section:

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

The following is a list of the supported parameters:

Name  (Required)

The name and location of the shortcut to create. Any of the shell folder constants or directory constants may be used in this parameter.

Keep in mind that shortcuts are stored as literal files so any characters not allowed in normal filenames can't be used here. Also, because it's not possible to have two files with the same name, it's therefore not possible to have two shortcuts with the same name.

Examples:
Name: "{group}\My Program"
Name: "{group}\Subfolder\My Program"
Name: "{commondesktop}\My Program"
Name: "{commonprograms}\My Program"
Name: "{commonstartup}\My Program"
Filename  (Required)

The command line filename for the shortcut, which normally begins with a directory constant.

In addition to file and folder names, URLs (web site addresses) may also be specified. When a URL is specified, Setup will create an "Internet Shortcut" (.url) file, and ignore the Parameters, WorkingDir, HotKey, and Comment parameters.

On 64-bit Windows, note that the {sys} constant will map to the native 64-bit System directory when the shortcut is launched by a 64-bit process, such as Windows Explorer. This is true regardless of whether the install is running in 64-bit mode. To create a shortcut that always points to the 32-bit System directory, use {syswow64} instead. (The same applies to the WorkingDir and IconFilename parameters.)

Examples:
Filename: "{app}\MYPROG.EXE"
Filename: "{uninstallexe}"
Filename: "{app}\FolderName"
Filename: "http://www.example.com/"
Parameters

Optional command line parameters for the shortcut, which can include constants.

Example:
Parameters: "/play filename.mid"
WorkingDir

The working (or Start In) directory for the shortcut, which specifies the initial current directory for the program. This parameter can include constants.

If this parameter is not specified or is blank, Setup will try to extract a directory name from the Filename parameter. If that fails (unlikely), the working directory will be set to {sys}.

Example:
WorkingDir: "{app}"
HotKey

The hot key (or "shortcut key") setting for the shortcut, which is a combination of keys with which the program can be started.

Note: If you change the shortcut key and reinstall the application, Windows may continue to recognize old shortcut key(s) until you log off and back on or restart the system.

Example:
HotKey: "ctrl+alt+k"
Comment

Specifies the Comment (or "description") field of the shortcut, which determines the popup hint for it. This parameter can include constants.

Example:
Comment: "This is my program"
IconFilename

The filename of a custom icon (located on the user's system) to be displayed. This can be an executable image (.exe, .dll) containing icons or a .ico file. If this parameter is not specified or is blank, Windows will use the file's default icon. This parameter can include constants.

Example:
IconFilename: "{app}\myicon.ico"

Note: when Setup is running on 64-bit Windows, it will automatically replace {pf32}\ in the filename with '%ProgramFiles(x86)%\' to work around a bug in 64-bit Windows: 64-bit Windows replaces {pf32}\ with '%ProgramFiles%\' which is incorrect.

IconIndex

Zero-based index of the icon to use in the file specified by IconFilename. Defaults to 0.

If IconIndex is non-zero and IconFilename is not specified or is blank, it will act as if IconFilename is the same as Filename.

Example:
IconIndex: 0
AppUserModelID

Specifies the Windows 7 Application User Model ID for the shortcut. Ignored on earlier Windows versions. This parameter can include constants.

Example:
AppUserModelID: "MyCompany.MyProg"
Flags

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

closeonexit

When this flag is set, Setup will set the "Close on Exit" property of the shortcut. This flag only has an effect if the shortcut points to an MS-DOS application (if it has a .pif extension, to be specific). If neither this flag nor the dontcloseonexit flags are specified, Setup will not attempt to change the "Close on Exit" property.

createonlyiffileexists

When this flag is set, the installer will only try to create the icon if the file specified by the Filename parameter exists.

dontcloseonexit

Same as closeonexit, except it causes Setup to uncheck the "Close on Exit" property.

excludefromshowinnewinstall

Prevents the Start menu entry for the new shortcut from receiving a highlight on Windows 7 and additionally prevents the new shortcut from being automatically pinned the Start screen on Windows 8 (or later). Ignored on earlier Windows versions.

foldershortcut

Creates a special type of shortcut known as a "Folder Shortcut". Normally, when a shortcut to a folder is present on the Start Menu, clicking the item causes a separate Explorer window to open showing the target folder's contents. In contrast, a "folder shortcut" will show the contents of the target folder as a submenu instead of opening a separate window.

This flag is currently ignored when running on Windows 7 (or later), as folder shortcuts do not expand properly on the Start Menu anymore. It is not known whether this is a bug in Windows 7 or a removed feature.

When this flag is used, a folder name must be specified in the Filename parameter. Specifying the name of a file will result in a non-working shortcut.

preventpinning

Prevents a Start menu entry from being pinnable to Taskbar or the Start Menu on Windows 7 (or later). This also makes the entry ineligible for inclusion in the Start menu's Most Frequently Used (MFU) list. Ignored on earlier Windows versions.

runmaximized

When this flag is set, Setup sets the "Run" setting of the icon to "Maximized" so that the program will be initially maximized when it is started.

runminimized

When this flag is set, Setup sets the "Run" setting of the icon to "Minimized" so that the program will be initially minimized when it is started.

uninsneveruninstall

Instructs the uninstaller not to delete the icon.

useapppaths

When this flag is set, specify just a filename (no path) in the Filename parameter, and Setup will retrieve the pathname from the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" registry key and prepend it to the filename automatically.

Example:
Flags: runminimized

Components and Tasks Parameters

Common Parameters