User Guide

503
Guidelines for Using Custom Actions
custom action is added to the installation to enable this passing of parameters. See
Custom Actions That Are Added Automatically on page 505.
In the User Interface or Execute Immediate sequences, you can send Windows Installer
properties to the .DLL function as parameters. The property’s current value is passed to
the function, and, if the function changes that value, the new value is put into the
corresponding property.
In the Execute Deferred sequence, the number of properties you can access is limited.
You can only access UserSID, CustomActionData, and ProductCode. CustomActionData
is filled with the property value of any Windows Installer property that has the same
name as the Custom Action. See Obtaining Context Information for Deferred Execution
Custom Actions in the Windows Installer SDK Help.
Debugging a Call Custom DLL Custom Action
You can debug .DLL functions while you are running an installation. Debugging a .DLL is
different from using the Debugger for Windows Installer, which shows the runtime
environment of the .MSI. Debugging a .DLL shows your .DLL code in Microsoft Visual
Studio. The following are requirements for using .DLL debugging:
! You authored the .DLL and have its source code on your computer.
! You have Microsoft Visual Studio installed.
! You are using one of the Call Custom DLL custom action types.
! MSDEV.EXE is in your path for debugging.
To enable debugging, use Setup Editor > Product tab to set the property named
_WiseDebugMode to 1. Then test or run the installation. Microsoft Visual Studio opens
and attaches to the installation process, and a breakpoint is invoked near the start of
your .DLL. You need to step a few times to get out of Windows Installer compiled code
and into your .DLL code.
Note
The debugging method described above only works with the Call Custom DLL custom action
types. It does not work with the Call DLL custom action types.