If you are working in an InstallScript MSI project, you will sometimes need to call a Windows Installer function. To do this, you will need a handle to the currently-running MSI database.
In a Basic MSI project, you have access to this handle from any InstallScript custom action. This is because hMSI is always one of the parameters passed to InstallScript functions in custom actions.
In InstallScript MSI projects, you have to use something different. Have a look at this code snippet:
ISMSI_HANDLE is the system variable you should use to access the currently-running MSI database.