I've not used the custom actions like that, so you are ahead of me.

Any chance of sharing some source? It sounds like you are doing a lot more
in C++ than I am, I'm still learning.

Regards

Ryan

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tony Juricic
Sent: 09 June 2008 23:01
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] A bit of info on CA data utility functions?

Thanks Ryan! You example is along the lines of this blog post that I
just found:
http://vadmyst.blogspot.com/2006/05/deferred-custom-actions-with-wix.htm
l

But my tests with Wca functions were also successful!

I have an immediate CA in a DLL. Exported function basically invokes a
bunch of
WcaWriteStringToCaData() and WcaWriteIntegerToCaData() calls with
existing properties and then calls:

WcaDoDeferredAction(L"MyCAName", customData, 0);

This DLL CA is scheduled right before the deferred "MyCAName" action.

On "the other side", in MyCAName action I can read stored strings and
integers in the order that I've written them. So it does what is
reasonable to expect from it.

Thanks, Tony

-----Original Message-----
From: Ryan O'Neill [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 09, 2008 5:05 PM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] A bit of info on CA data utility functions?

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
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