Property Values containing brackets [] try to resolve a value - Advanced Installer Community
korr
Posts: 48
Joined: Tue Sep 09, 2014 3:13 pm

Property Values containing brackets [] try to resolve a value

I have a WIX Custom Action DLL to perform various regex actions, when I send across a property that contains a set encased in brackets Advanced Installer attempts to translate this as if it were another property.

For example I send across for a match the following CustomActionData :

Code: Select all

Pattern=[PATTERN];Text=[TEXT];ResultsProperty=RESULTS
PATTERN = .*://.*:([0-9]+)/
TEXT = net.tcp://localhost:8060/MyService
In the log I see the following :

Code: Select all

MSI (c) (F8:8C) [11:26:18:486]: PROPERTY CHANGE: Adding CustomActionData property. Its value is 'Pattern=.*://.*:([0-9]+)/;Text=net.tcp://localhost:8060/MyService;ResultsProperty=RESULTS'.
The logging in the WIX custom action shows me this (this is the value of the variable after assigned as 'string pattern = session.CustomActionData["Pattern"])' though it is the same if i just pull the CustomActionData["Pattern"] directly) :

Code: Select all

MSIRegex: pattern = .*://.*:(+)/
MSIRegex: text = net.tcp://localhost:8060/MyService
So the difference is that the value for pattern once received (as a section of the customactiondata) is missing the [0-9] because Advanced Installer is attempting to find a property named [0-9] which doesnt exist and resolves to being blank.


I have confirmed this by creating a property named [FOO] with the value Bar, if I replace the [0-9] in the pattern with [FOO], I end up with Bar in the value sent.


Is there a way around this? It happens even if I pull the property with session["PROPERTY"] (which is not something I wanted to do to begin with) as well as if i attempt to use the session["CustomActionData"] entirely.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Property Values containing brackets [] try to resolve a value

Hi and welcome to Advanced Installer forums,

Advanced Installer uses formatted fields to resolve installer properties throughout the application. If you need to escape straight brackets so properties don't get resolved, you can use something like:

Code: Select all

[\[]YOUR_PUBLIC_PROPERTY[\]]
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”