CreateShortcut Method

Top  Previous  Next

Lokas Software AWinstall Online Help
Start Page
Engine Functionality
Tasks and Actions
Installer Variables
Reading from Registry and Environment
Tips And Tricks
Frequently Asked Questions
Installer Actions
Extract Files with Folders
Register COM DLL
Register COM Type Library
Create Shortcuts and Start Menu Items
Register Fonts
Add Registry Keys
Add Keys from .reg file
Add Keys from System Registry
Run External Programs
Add Uninstall Shortcut
Setup Builder Interface
Main Windows
Property Pane
Project Tree
Event Log
Menu bar commands
File
Edit
View
Project
Task
Help
Toolbars
Standard
Actions
Extending your setups
Script Actions
Installer Object
AddRegKey Method
CancelInstall Method
CopyFile Method
CreateObject Method
CreateShortcut Method
RegisterFont Method
RegisterServer Method
RegisterTypeLib Method
RunProgram Method
ShowMessage Method
Variables Method
VersionMajor Property
VersionMinor Property
General Information
Product Registration
History of Changes
  download AWinstall

Creates a shortcut (shell link).

[VBScript]

Installer.CreateShortcut ShortcutPath, ObjectPath, Description, _

      Parameters, WorkingDir, IconLocation, _

      IconIndex, ShowCommand, HotKey

 

[JScript]

Installer.CreateShortcut(ShortcutPath, ObjectPath, Description,

      Parameters, WorkingDir, IconLocation,

      IconIndex, ShowCommand, HotKey);

Parameters

ShortcutPath

The target shortcut path.

ObjectPath

The path to Shell link object (file, folder).

Description

The description string.

Parameters

The shortcut command parameters (for executable objects only).

WorkingDir

The working directory where the shortcut will be opened.

IconLocation

The path to shortcut icon location. Use with IconIndex. To omit this parameter, use empty string.

IconIndex

The 0-based index of icon in the icon container. Use 0 for .ico files and icon order number for executables and icon libraries (.exe, dll, .icl).

ShowCommand

The numeric window state value (see below). Use 0 to omit this parameter.

HotKey

The numeric Hot Key value (valid for Desktop links only). Refer to MSDN for valid keys values. Use 0 to omit this parameter.

Remarks

Installer variables are supported in the following parameters: ShortcutPath, ObjectPath, Description, Parameters, WorkingDir and IconLocation. To emit the value of installer variable MyVar, use the form ${MyVar}.

The ShowCommand parameter supports the following values:

Constant

Windows API Name

Description

1

SW_SHOWNORMAL

Open the shortcut in a normal window.

2

SW_SHOWMINIMIZED

Open the shortcut in a minimized window.

3

SW_SHOWMAXIMIZED

Open the shortcut in a mazimized window.

Uninstall support

This action supports automatic uninstallation.

Example (VBScript)

' Create shortcut to Windows calculator program

Installer.CreateShortcut "${DesktopPath}\Calc""${SystemPath}\calc.exe", _

  "The calculator program""param1""${ProductPath}", _ 

  "${SystemPath}\moricons.dll", 12, 0, 0

Example (JScript)

// Create shortcut to Windows calculator program

Installer.CreateShortcut("${DesktopPath}\\Calc""${SystemPath}\\calc.exe",

  "The calculator program""param1""${ProductPath}"

  "${SystemPath}\\moricons.dll", 12, 0, 0);

© 2007 Lokas Software