Specifying Whether End Users Should Be Able to Pin a Shortcut to the Taskbar or Start Menu

InstallShield 2016

Project • This information applies to the following project types:

Basic MSI
DIM
InstallScript
InstallScript MSI
Merge Module
MSI Database
MSM Database
Transform

Project-specific differences are noted where applicable.

InstallShield lets you specify whether you want the context menu commands for pinning a shortcut to the taskbar and to the Start menu are to be displayed after end users install your product. You may want to disable pinning for shortcuts that are for tools and secondary products that are part of your installation. Note that if you configure the shortcut to prevent this pinning, the target of the shortcut is ineligible for inclusion in the most frequently used list on the Start menu.

If you configure a shortcut to prevent this pinning functionality, the installation sets a Windows Shell property. By default, the property is not set for new shortcuts, so end users are able to pin the shortcut to the taskbar and to the Start menu.

Note that shortcuts that contain certain strings cannot be pinned to the taskbar or the Start menu, and they cannot be displayed in the most frequently used list. Examples are:

Documentation
Help
Install
Remove
Setup
Support

Note that the method for hiding the context menu commands varies, depending on the project type that you are using.

Instructions for Windows Installer–Based Projects

For Basic MSI, DIM, InstallScript MSI, Merge Module, MSI Database, MSM Database, and Transform projects, use the Shell Properties setting to hide the context menu commands.

To hide the context menu commands for pinning a shortcut to the taskbar or Start menu:

1. In the View List under System Configuration, click Shortcuts.
2. In the Shortcuts explorer, select the shortcut that you want to configure. The shortcut’s settings are displayed in the right pane.
3. In the Shell Properties setting, click the Add New Shell Shortcut Property button, and then click Prevent Pinning. InstallShield adds a new Key Name setting, plus additional rows of related settings under it, and configures them as needed.

To allow the context menu commands to be displayed, find the Key Name setting that has a Property subsetting with either of the following, and click the Delete this shortcut shell property button in the Key Name setting:

System.AppUserModel.PreventPinning
{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}, 9

Windows Installer 5 introduced support for this shortcut property. Earlier versions of Windows Installer ignore this setting.

Note that for Windows Installer–based installations, some end users have reported run-time warnings or errors with a message such as the following one when Windows Installer is installing a shortcut that configures Shell properties:

Property [1] for shortcut ’[2].lnk’ could not be set.

In the aforementioned message, [1] is the name of the Shell property that Windows Installer is attempting to set, and [2].lnk is the name of the shortcut file. In such cases, it appears that the .lnk file could be locked by a different process.

Instructions for InstallScript Projects

For InstallScript projects, use the Prevent Pinning setting.

To hide the context menu commands for pinning a shortcut to the taskbar or Start menu:

1. In the View List under System Configuration, click Shortcuts.
2. In the Shortcuts explorer, select the shortcut that you want to configure. The shortcut’s settings are displayed in the right pane.
3. In the Prevent Pinning setting, select Yes.

Windows 7 introduced support for this setting. Earlier versions of Windows ignore this setting.

InstallScript Language Support

The following InstallScript functions enable you to hide the context menu commands for pinning a shortcut to the taskbar or the Start menu:

CreateShortcut
SetShortcutProperty

See Also