I have a project with 2 different .cpp`s. MyProj consists of MyCPP1 and MyCPP2 MyCPP1 contains different functions to be executed from msi using wix.
extern "C" __declspec(dllexport) UINT __stdcall MyCAFunction(MSIHANDLE hInstall)
{
TCHAR name[MAX_PATH] = {0};
DWORD nameLen = MAX_PATH;
TCHAR keydir[MAX_PATH] = {0};
DWORD keydirLen = MAX_PATH;
MsiGetProperty (hInstall, L"Val1", name, &nameLen);
MsiGetProperty (hInstall, L"Val2", keydir, &keydirLen);
}
and the wix code is:
<CustomAction Id="MyCA.Props" Return="check" Property="MyCA" value="Val1=[LogonUser];Val2=[INSTALLDIR]"/>
<CustomAction Id="MyCA" Return="check" Execute="deferred" BinaryKey="Binary1" DllEntry="_MyCAFunction@4" HideTarget="no" />
<Binary Id="Binary1" SourceFile="$(var.ConfDir)MyProj.dll" />
Well... so i have an error:
Error 1723: A DLL required for this install to complete could not be run.
What way i need to dig?
I have some thoughts in the way of CA types... such as the basic type of CA with FileKey reference is 17. but my CA type is 1041 (Orca helps). Could it be the issue of my problem?
I've checked the version with diferent types of CA. its just coz of the parameters of CA (just deleting Execute="deferred" change type from 1041 to 17 (standart type). THe last thing of solving this ussue is the dll. I'll see it today... any sujestions?
Tried different ways of building dll's. Works just the dll, built by the example project of C++ Wix Custom Action Project. I compared 3 or 4 different projects. By props, by links, by external dependancies... Cannot find the issue... Help me...
Check the names of the functions exported from your DLL.
To do it, run dumpbin
utility on your DLL with /exports
flag.