Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix: Set semicolon to CustomActionData

I have a problem with setting data that contains semicolons to CustomActionData property. By default CustomActionData class uses semicolon as DataSeparator and it breaks my data, when it contains semicolons. Is there any way to put semicolons to CustomActionData except of replacing them by come keyword?

like image 361
Roman Kuzyk Avatar asked Apr 07 '11 10:04

Roman Kuzyk


1 Answers

to pass a semicolon in your CustomActionData you should add one more semicolon.

Example:

CustomActionData="key1=value1;key2=value2.1;;value2.2;;value2.3" - this will pass key1=value1 and key2=value2.1;value2.2;value2.3

If you don't know where the semicolons are then I guess you can create method that escapes them by replacing each semicolon with two semicolon.

If there are more symbols that you don't know how to escape you easily find out creating a simple app that creates a CustomActionData instance, adds a key-value pair and outputs the CustomActionData string representation using ToString().

Example:

CustomActionData data = new CustomActionData();
data.Add("key1", "value1");
data.Add("key2", "value2.1;value2.2;value2.3");

Console.WriteLine(data.ToString());

I hope the information is helpful.

like image 124
Petar Raykov Avatar answered Sep 22 '22 13:09

Petar Raykov