[wix-users] How to use WcaReadStringFromCaData?

Hoover, Jacob Jacob.Hoover at greenheck.com
Thu Jul 20 08:36:31 PDT 2017


https://www.firegiant.com/wix/tutorial/events-and-actions/at-a-later-stage/

Or..
"Should we need to pass more than one piece of information, we have to devise a way to incorporate them into this single property, for instance, to use a semicolon separated list of Name=Value pairs."

Ex:
<CustomAction Id="MyAction.SetProperty" Return="check" Property="MyAction" Value="Param1=[SOME_PUBLIC_PROPERTY];Param2=[ANOTHER_PROP];" />



-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Edwin Castro
Sent: Wednesday, July 19, 2017 6:26 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] How to use WcaReadStringFromCaData?

Normally you'd use WcaWriteStringToCaData (and it's siblings) to create your custom action data in an immediate custom action. If you're creating the custom action through a different mechanism then you'll want to ensure the correct separator is used somehow.

--
Edwin G. Castro


On Wed, Jul 19, 2017 at 1:02 PM, Joel Budreau <joel.budreau at gmail.com>
wrote:

> More Info:
>
> Today I pass ca data like "param1;param2", so I have added code 
> similar to this in my custom action:
>
>    // Replace ";" delimiters with wcautil-friendly 'magic' delimiter
>    WCHAR delim[] = { MAGIC_MULTISZ_DELIM, 0 }; // magic char followed 
> by NULL terminator
>    hr = StrReplaceStringAll(&pwzCaData, L";", delim);
>    ExitOnFailure(hr, "Failed to replace CustomActionData delimiters");
>    pwz = pwzCaData;
>    hr = WcaReadStringFromCaData(&pwz, &pwzParam1);
>    ExitOnFailure(hr, "Failed to parse Param1.");
>    hr = WcaReadStringFromCaData(&pwz, &pwzParam2);
>    ExitOnFailure(hr, "Failed to parse Param2.");
>
> This seems to defeat the purpose of using the 'magic' character in the 
> first place, right?
>
> - Joel
>
> On Wed, Jul 19, 2017 at 12:39 PM, Joel Budreau 
> <joel.budreau at gmail.com>
> wrote:
>
> > I'm looking to write a deferred custom action that parses the 
> > CustomActionData property by using wcautil's 
> > WcaReadStringFromCaData() function. I populate the CustomActionData 
> > property through a Type51
> custom
> > action in the MSI.
> > - How do I go about changing the delimiter from MAGIC_MULTISZ_DELIM 
> > to something else?
> > - Do I author the {0x80,0} character inside my wix source?
> > - Am I supposed to be authoring the CustomActionData through another 
> > immediate custom action??
> >
> > Thanks,
> > Joel
> >
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant 
> http://www.firegiant.com/
>

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



More information about the wix-users mailing list