User Guide
502
Guidelines for Using Custom Actions
The return values for nested installation actions are the same as for other custom
actions. See Custom Action Return Values in the Windows Installer SDK Help.
Guidelines for Calling VBScripts and JScripts
You can create a custom action that calls a JScript or VBScript file that you’ve authored.
You cannot pass parameters to JScript or VBScript. You must use your script to read and
write properties to the installation—your script can access the current installation
session. The exceptions are the Call JScript From Embedded Code and Call VBScript
From Embedded Code. They let you store the script inside the custom action and resolve
formatted property names and other references. Make sure the destination computer
contains the runtime for JScript or VBScript.
You can call scripts using custom actions, but you must author the JScript or VBScript.
The built-in Macro Editor is not meant to author JScripts and VBScripts that you call from
custom actions. For help authoring the script, see the following topics in the Windows
Installer SDK Help:
Scripts
Obtaining Context Information for Deferred Execution Custom Actions
Downloading an Installation From the Internet
Return Values of JScript and VBScript Custom Actions
How do I access the current installer session from inside a custom action?
Guidelines for Calling .DLLs
There are 2 types of custom actions that call .DLLs from an installation: Call DLL Custom
Actions and Call Custom DLL Custom Actions.
Call DLL Custom Actions
Two custom actions—Call DLL From Installed Files, Call DLL From Installation—use the
Windows Installer method for calling .DLLs, which does not allow you to send any
specific parameters to the .DLL. The only parameter you can send is the handle (of type
MSIHANDLE) for the current installation session. From within your .DLL, you must use
Windows Installer function calls to access the current installer session and database
properties. Also, the return value for the .DLL is limited to a constant specifying whether
the .DLL call was successful. See Custom Action Return Values in the Windows Installer
SDK Help. Your function declaration statement should look something like this:
UINT__stdcall CustomActionName(MSIHANDLE hInstall)
To write your .DLL function according to Windows Installer guidelines, see the following
topics in the Windows Installer SDK Help:
Dynamic-Link Libraries
How do I access the current installer session from inside a custom action?
Custom Action Type 1
Custom Action Type 17
Call Custom DLL Custom Actions
Three custom actions—Call Custom DLL From Installation, Call Custom DLL from
Installed Files, Call Custom DLL From Destination Computer—allow variable parameter
lists to be sent to the .DLL. These actions are passed through a .DLL authored by Wise
Solutions. This method for calling .DLLs is an alternative to the Windows Installer
method. This method works with the way you typically code .DLL functions, and does
not require you to code your functions according to Windows Installer guidelines.
However, if you use this method, you should be aware that your .DLL call gets passed
through a Wise-created .DLL that handles the passing of parameters. A Wise-created