InstallAware for Windows Installer
 

Call DLL Function

This plug-in provided command calls a function exported from a DLL. The function must be available under the specified function name and use the __stdcall calling convention.

DLL Path

The full path to the DLL file that exports the function. If a full path is not specified, the DLL will be loaded using the same guidelines that the LoadLibrary API call uses.

Function Name

The name of the function to call that the DLL exports. If the function with the indicated name is not exported from the DLL, the plug-in will make a second attempt to load a function exported with a "W" character appended to the function name.

Parameter Type

Indicates the type of the parameter being passed to the function.

Parameter Value

Indicates the value of the parameter being passed to the function. If a variable is provided in this field, and the parameter is being passed to the function by reference, the passed variable will contain the new value of the parameter. If a variable is not provided, even if the parameter is being passed by reference, the new value of the parameter will not be obtained.

Return Type

Indicates the return type of the function.

Return result in variable

Indicates the variable to hold the result of the function call. If the function call succeeds and the function has a void return parameter, this field is empty. If the function call succeeds and the function has a non-void return parameter, this field is set to the return value of the function. If the function call fails, the variable will hold one of the following values:

Value Meaning
DLLLOADFAILED The DLL could not be loaded. It may not exist at the given path or one or more of its dependencies may be missing.
FUNCTIONNOTFOUND A function with the given name, or the given name appended with an "W", is not exported from the DLL.
EXTERNALEXCEPTION An exception occured while executing the function code in the DLL.

If specified, this variable must have been previously defined in the setup script using the Set Variable command.

 Notes

  • You may use the Call DLL Function command to call virtually any Windows API function.
  • Be sure to use Unicode versions of the Windows API functions you call. Such API calls typically end with an "W". For instance, enter SetCurrentDirectoryW into the Function Name field to change the current directory.
  • If you must use ANSI versions of Windows API functions, enter the full function name, including the ending "A", such as SetCurrentDirectoryA to change the current directory.
  • When passing variables, be sure to use the convention $VARIABLENAME$.