Search code examples
wixcustom-action

How to pass string with symbol ";" from CustomActionData to a CustomAction using WiX?


I have deferred CustomAction in C# and another one to pass some properties to it.

<CustomAction Id="CustomAction1"
              Property="CustomAction2"
              Value="EncryptedString=[ENCRYPTEDSTRING]"
/>

However, if the property contain symbol ";" then

string encString=session.CustomActionData["EncryptedString"];

outputs only part before ";", because this symbol is considered as a delimiter between properties. Is there any workaround to pass strings containing ";" ?

for example

ENCRYPTEDSTRING="12;3474dsfgee"

and output

encString="12"

Solution

  • You can't use DTF's CustomActionData; it assumes the custom action items are delimited by semicolons. Instead, grab CustomActionData directly and don't bother with the EncryptedString= prefix.