Not quite sure of your question, but the following may be of help.

My understanding is that deferred custom actions cannot read the normal MSI
properties and can only access data through the CustomActionData property.
This is because they are run outside the scope of the UI in a separate
transaction, after the UI has been completed.

You may be on to something but I don't 'think' those functions will help
you. You'll have to write a delimited string into CustomActionData.

To set that property, do the following from your WXS (an extract from my
code);
    <!-- Populate a property with the same name as the custom action, this
gets passed to that action DLL call as CustomActionData -->
    <CustomAction Id="CA_SetCleanLocalAppData" Property="CleanLocalAppData"
Value="[LocalAppRootDirectory]" />
    <!-- Pass the current users data path to the NukeFolder action to clean
the directory on uninstall.  -->
    <CustomAction Id="CleanLocalAppData" BinaryKey="InstallHelper"
DllEntry="NukeFolder" Execute="deferred" />
Note that the property of the first CA is the same name as the second CA.
This is how you set CustomActionData, you set a property with the same name
as the CA you are calling. In the above example it passed the directory to
delete to the custom action.

The Custom action C++ code looks like;

__declspec(dllexport) UINT __stdcall NukeFolder(MSIHANDLE hModule)
{
        TCHAR szDirectoryToDelete[MAX_PATH];
        DWORD dwlen = MAX_PATH;

        UINT ur = MsiGetProperty(hModule, TEXT("CustomActionData"),
szDirectoryToDelete, &dwlen);

        // TODO: Handle error return.
        DeleteDirectory(szDirectoryToDelete);

        return ERROR_SUCCESS;
}
 
I hope that helps in some way.

Ryan

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tony Juricic
Sent: 09 June 2008 21:44
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] A bit of info on CA data utility functions?

Can anybody give a brief intro on how to use deferred CA data functions
such as
WcaDoDeferredAction,
WcaWriteStringToCaData,
WcaReadStringFromCaData, etc. ?

I have a deferred custom action that needs to read a lot of properties
and these functions seem like the right ones to use. 

Deferred actions need an immediate action for setting the data for its
use and that is where these functions would presumably be called? But
how?

For ex, in the case of the call:

HRESULT WIXAPI WcaReadStringFromCaData(
    __inout LPWSTR* ppwzCustomActionData,
    __inout LPWSTR* ppwzString
    );

were does ppwzCustomActionData come from? From the call MsiGetProperty
(hInstall, "CustomActionData",..)?
If that is the case I guess what is confusing me is that
ppwzCustomActionData is of type inout.

Any comments would be appreciated,
Tony

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 270.1.0/1492 - Release Date: 09/06/2008
10:29


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to