ISWiShortcut Object

InstallShield 2016 » Automation Interface

Project • This information applies to the following project types:

Basic MSI
DIM
InstallScript
InstallScript MSI
Merge Module

Project-specific differences are noted where appropriate.

The ISWiShortcut object represents a shortcut in the Shortcuts explorer. The shortcut can be an existing item in an ISWiShortcuts collection or one you just created by calling AddShortcut.

Use this object's properties to set the shortcut's attributes in much the same manner as you would in the IDE.

Members

ISWiShortcut Object Members

Name

Project

Type

Description

AddShellProperty

Basic MSI, InstallScript MSI, Merge Module

Method

Adds a Shell property for the current shortcut object.

Arguments

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Gets or sets the command-line arguments that will be passed to the target file. You can substitute "%1" for the file name. The following statement might launch the target file in silent mode:

m_pShortcut.Arguments = "-s"

DeleteShellProperty

Basic MSI, InstallScript MSI, Merge Module

Method

Deletes the specified Shell property from the current shortcut object.

Description

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Contains any descriptive text you have entered for this shortcut. The description is displayed as a tooltip. If this property uses a string entry, Description gives you the value for the string entry identified by the ActiveLanguage property of ISWiProject.

DisplayName

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Contains the display name you have entered for this shortcut. This name is a localizable value that will be used for the shortcut's name when it is installed instead of the name that identifies the shortcut in the Shortcuts explorer. If this property uses a string entry, DisplayName gives you the value for the string identified by the ActiveLanguage property of ISWiProject.

DoNotHighlightAsNew

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Gets or sets a Boolean property that indicates whether the shortcut is configured to be highlighted on the Start menu as new after end users install the product. This has the same effect as clearing the Highlight newly installed programs check box in the Customize Start Menu dialog box for an individual item on a target system.

To prevent the Start menu shortcut from being highlighted as newly installed, set this Boolean property to True. To enable the shortcut to be highlighted, set this Boolean property to False.

For more information about this highlight functionality, see Preventing a Shortcut on the Start Menu from Being Highlighted as Newly Installed.

EnableWin8StartPin

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Gets or sets a Boolean property that indicates whether the shortcut is configured to be pinned by default to the Start screen on Windows 8 target systems.

To pin the shortcut by default, set this Boolean property to True. To disable pinning, set this Boolean property to False.

For more information about this pinning functionality, see Suppressing Initial Pinning of a Shortcut to the Windows 8 Start Screen.

HotKey

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Stores the accelerator key for this shortcut as a Long.

IconFile

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Enter the fully qualified path to the file that contains the icon for this shortcut. You must specify either an executable file that contains the icon resource or an .ico file. (Windows Installer based projects only:) If you leave this property blank, the key file of the component will automatically be set as the shortcut's icon.

Because Windows Installer requires a separate icon when the component is advertised, InstallShield extracts the icon from the executable you specify. You must set the IconIndex property if there is more than one icon resource in the executable.

IconIndex

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Contains the index for the specified icon as a Long if there is more than one icon resource in IconFile.

A nonnegative integer refers to the order of the icon resources in the executable. For example, 0 is for the first icon in the file, 1 for the second, 2 for the third, and so on. Use a negative number to refer to a specific resource ID. For example, the icon index -12 points to the icon with a resource ID of 12.

InternetShortcut

InstallScript

Read-Write Property

Gets or sets the Internet Shortcut property for this shortcut, which specifies whether the shortcut is an Internet shortcut that points to the Uniform Resource Locator (URL) specified in the shortcut's Target property. This property is Boolean.

ISWiShellProperties

Basic MSI, DIM, InstallScript MSI, Merge Module

Collection

Contains all of the Shell properties for the current shortcut object.

Name

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Only Property

Retrieves the name of the shortcut. This is the same name that appears in the Shortcuts explorer; do not confuse it with the shortcut's Display Name property.

PreventPinning

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Gets or sets a Boolean property that indicates whether you want the context menu commands for pinning a shortcut to the taskbar and to the Start menu to be displayed after end users install your product.

To hide the context menu commands for pinning the shortcut to the taskbar or Start menu, set this Boolean property to True. To display the context menu commands and allowing pinning, set this Boolean property to False.

For more information about this pinning functionality, see Specifying Whether End Users Should Be Able to Pin a Shortcut to the Taskbar or Start Menu.

ReplaceExistingIfFound

InstallScript

Read-Write Property

Gets or sets the Replace Existing (If Found) setting for this shortcut, which specifies whether the shortcut should replace an already existing shortcut with the same display name in the same location on the target system. This property is Boolean.

ShowCmd

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Specify one of the following options for determining what mode the file is opened with:

scNormal (1)—The program launches in a normal-sized window.
scMaximized (3)—The program launches in full-screen view.
scMinNoActive (7)—The program launches in a minimized window, visible only on the taskbar.

Target

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Provide the path and file name for this shortcut's target file. Instead of hard-coding a path, you can use a Windows Installer directory property in square brackets—for example, [INSTALLDIR]MyApp.exe—or, in an InstallScript project, a system variable in angle brackets—<TARGETDIR>\MyApp.exe.

(Windows Installer based projects only:) If you leave this property blank, the key file of this component will automatically be set as the shortcut's target.

Uninstall

InstallScript

Read-Write Property

Gets or sets the Uninstall property for this shortcut, which specifies whether the shortcut is removed when the application is uninstalled. This property is Boolean.

UserType

InstallScript

Read-Write Property

Gets or sets the Type property for this shortcut, which specifies whether you want the shortcut to appear in the list of personal shortcuts for the user installing your application, in the list of shortcuts that are common to all users, or if you would like the setup to decide automatically based on the value of the ALLUSERS system variable. Specify one of the following options for determining what mode the file is opened with:

estAutomatic (0)—The shortcut appears in the list of common shortcuts if ALLUSERS is non-zero, or in the list of personal shortcuts if ALLUSERS is FALSE.
estCommon (1)—The shortcut appears in the list of shortcuts that are common to all users.
estPersonal (2)—The shortcut appears in the list of personal shortcuts for the user installing your application.

WorkingDirectory

Basic MSI, InstallScript, InstallScript MSI, Merge Module

Read-Write Property

Specify the string that becomes the shortcut's “start in” folder. Instead of hard-coding a path, you can use a Windows Installer directory property in square brackets—for example, [INSTALLDIR]MyApp.exe—or, in an InstallScript project, a system variable in angle brackets—<TARGETDIR>\MyApp.exe.

Applies To

ISWiFolder