CreateShortcut function

Create a shortcut to a file or folder outside the normal shortcut installation procedure.

The CreateShortcut function is a predefined extension DLL function that is distributed with InstallMate. You can use this function by adding a Run DLL action to the action sequence in which you want to run the action. Set the Run DLL action attributes as follows:


The CreateShortcut function expects the following arguments. All arguments may contain symbolic references; these will be resolved before the function is called. Note that you must "quote" an argument if it contains spaces, or if it could contain spaces after expansion of symbolic references.

The folder in which to create the shortcut, for example "<DesktopFolder>".
The name for the shortcut as shown to the user, for example "Start WhizBang".
The target file or folder path for the shortcut, for example "<INSTALLDIR>\WB.exe".
[Optional] Any arguments that should be passed to the target file when started through the shortcut, for example /update.
[Optional] Optional start folder for the shortcut, for example "<INSTALLDIR>". If you want to use this option, you must also include the args option, even if that option is empty.

Return value

Returns ERROR_SUCCESS (zero) if successful, else a nonzero error code. This error code is available in the LastExitCode variable.


To use this function, you must add the extension DLL to your InstallMate project. The easiest way to do so is as follows:

  1. Open your InstallMate project.
  2. Choose File > Import > Project Items... from the main menu bar.
  3. Browse for and select the file Insert Extension DLL.imq, then click Open.

Alternatively, you can go to the Installer options page in your InstallMate project, click on the Advanced... button, then click on the Extension DLL tab and enter the paths to the extension DLL versions there.