Windows Installer Editor Reference
457
Using MSI Script
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
Accessing the current installer session from inside a custom action?
Guidelines for Calling .DLLs
The types of custom actions that call .DLLs from an installation are 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
Accessing 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 Wise .DLL. 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 custom action is added to the
installation to enable this passing of parameters.
See
Wise Custom Actions
on page 502.