So here's how this post will help you
PRE-CONDITIONS:
1. You are writing a C/ C++ Custom Action DLL which is stored as a Binary in the installer.
2. You have already created a .DEF file which exports the DLL entry point. (Sanity test)
3. Comment out any code that uses the MSIHANDLE parameter.
The best way is to create a stand alone .exe file which attempts to run the custom action dll. Here's what that code looks like:
#include "stdafx.h"
#include <msi.h>
typedef UINT (__stdcall * PCUSTOMACTION)(MSIHANDLE handle);
int _tmain(int argc, _TCHAR* argv[])
{
MSIHANDLE handle = 0;
HMODULE library = LoadLibrary(L"CustomAction.dll");
if (library != NULL)
{
PCUSTOMACTION pCustomAction = (PCUSTOMACTION)GetProcAddress(library, "DllEntryPoint");
if (pCustomAction != NULL)
{
pCustomAction(handle);
}
}
return 0;
}
Run it with your favorite debugger attached, and voila!