Finally got the linker errors resolved. I run my msi, and if I leave
the name or email blank, instead of an error, the installer just quits.
Here's the CA:
UINT __stdcall VerifyUserInformation(__in MSIHANDLE hInstall)
{
wchar_t *filePath = L"C:\\Log.txt";
log(filePath, L"Inside VerifyUserInformation(__in MSIHANDLE
hInstall)");
LPWSTR userName = NULL;
LPWSTR email = NULL;
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
hr = WcaInitialize(hInstall, "VerifyUserInformation");
ExitOnFailure(hr, "Failed to Initialize");
log(filePath, L"After initialize");
hr = WcaSetProperty(L"UserInfoError", L"");
ExitOnFailure(hr, "Failed to initialize UserInfoError");
log(filePath, L"After set property");
if (WcaIsPropertySet("UNAME"))
{
log(filePath, L"Inside (WcaIsPropertySet('UNAME')");
hr = WcaGetProperty(L"UNAME", &userName);
log(filePath, userName);
ExitOnFailure(hr, "Failed to get UNAME.");
WcaLog(LOGMSG_VERBOSE, "UNAME is %ls.", userName);
}
if (WcaIsPropertySet("EMAIL"))
{
log(filePath, L"Inside (WcaIsPropertySet('EMAIL')");
hr = WcaGetProperty(L"EMAIL", &email);
log(filePath, email);
ExitOnFailure(hr, "Failed to get EMAIL.");
WcaLog(LOGMSG_VERBOSE, "EMAIL is %ls.", email);
}
if(wcslen(userName) == 0)
{
log(filePath, L"Inside (wcslen(userName) == 0)");
hr = WcaSetProperty(L"UserInfoError", L"Please enter your name.");
WcaLog(LOGMSG_VERBOSE, "Please enter your name.");
}
else if(wcslen(email) == 0)
{
log(filePath, L"Inside (wcslen(email) == 0)");
hr = WcaSetProperty(L"UserInfoError", L"Please enter your email
address.");
WcaLog(LOGMSG_VERBOSE, "Please enter your email address.");
}
log(filePath, L"After all the if statements");
LExit:
/* ReleaseStr(userName);
ReleaseStr(email); */
if (FAILED(hr))
{
er = ERROR_INSTALL_FAILURE;
}
return WcaFinalize(er);
}
Here's the xml with the call to the CA:
<CustomAction Id="verifyUserInformation" BinaryKey="installerDLL"
DllEntry="VerifyUserInformation" Execute="immediate"
Return="check"></CustomAction>
<Publish Event="DoAction" Value="verifyUserInformation"
Order="1">1</Publish>
<Publish Event="SpawnDialog" Order="2" Value="ConfigDlg"><![CDATA[
UserInfoError ]]></Publish>
<Publish Event="NewDialog" Order="3" Value="PassDlg"><![CDATA[ NOT
UserInfoError ]]></Publish>
I added some logs (as you can see) to see what was going on. I get the
log "After Set Property", and that's it. Nothing else after that. Not
even one for "After all the if statements".
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users