Hey,
This is some code that I used to do that. I think you can look into the
shellexecca.cpp<http://wix.cvs.sourceforge.net/viewvc/wix/wix/src/ca/wixca/dll/shellexecca.cpp?hideattic=1&revision=1.4&view=markup&pathrev=MAIN>
file.
HRESULT hr = S_OK;
UINT er = ERROR_SUCCESS;
LPWSTR pwzStreamToString = NULL;
BYTE* pbData = NULL;
DWORD cbData = 0;
hr = WcaInitialize(hInstall, "ScheduleMuConfig");
ExitOnFailure(hr, "failed to initialize ScheduleMuConfig");
//Extact the muauth.cab to a stream.
hr = ExtractBinary(L"MuAuthCab", &pbData, &cbData);
ExitOnFailure(hr, "failed to extract binary data");
//Write the stream to a string to be passed as CustomActionData
hr = WcaWriteStreamToCaData(pbData, cbData, &pwzStreamToString);
ExitOnFailure(hr, "failed to write the stream to a string");
hr = WcaDoDeferredAction(L"RollbackConfigMU", L"Rollback", 0);
ExitOnFailure(hr, "Failed to schedule RollbackConfigMU");
hr = WcaDoDeferredAction(L"ConfigureMU", pwzStreamToString,
COST_MU_CONFIG_TRANSACTION);
ExitOnFailure(hr, "Failed to schedule ConfigureMU");
LExit:
ReleaseStr(pwzStreamToString);
ReleaseMem(pbData);
if (FAILED(hr))
{
er = ERROR_INSTALL_FAILURE;
}
return WcaFinalize(er);
Brian Rogers
"Intelligence removes complexity." - Me
http://icumove.spaces.live.com
On Mon, Jan 26, 2009 at 12:03 AM, Pratapa Reddy Sanaga <
[email protected]> wrote:
> Hi,
>
> I'm placing a .pfx certificate in the binary table and wish to retrieve it
> in my deferred custom action dll. From what I read on the forum, I see that
> this can be achieved by reading the certificate using immediate custom
> action, write it to custom action data(or to a temporary file, which I
> don't
> prefer) and then call the deferred custom action that can use this data.
> Can
> someone please help me with the following doubts:
>
> 1. What APIs should I be looking at, to write to custom action data in an
> immediate custom action?
> 2. The certificate is purely binary data and all the APIs return strings.
> So, I'm afraid that I'd loose some data if there is a NULL in the binary
> data. How can I handle this situation?
> 3. I have a URI that should also be placed in the custom action data. So,
> how can I append the certificate's binary stream to the custom action
> data(which contains the URI already)?
>
> Thanks,
> Pratapa.
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> WiX-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users