cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
TonyLowrey
Level 3

Property recursive substitution

I would like to set a reg key to the value of a property but substitute any properties in that property. e.g.
Set Property REG_VAL="This is the product name [ProductName]"
where ProductName is "MyProduct"
set the reg value to [REG_VAL] and get the ProductName substituted e.g. the reg value becomes "This is the product name MyProduct"
I have tried combinations of {..} and [..] in set property custom actions but the properties inside are not substituted.
I would hate to resort to vbscript to perform the substitution.
Help!
Tony
Labels (1)
0 Kudos
(4) Replies
alphacz
Level 5

So you tried creating a CA called REG_VAL and set the text to be:
This is the product name [ProductName]. I didn't use quotes - not sure if that makes a difference.

And then when you tried to set a registry value to REG_VAL, it is putting - This is the product name [ProductName] in the value rather than - This is the product name Product1?

If this is what you are trying to do, I just tested this and it seems to work as expected... I've attached my test ism.
0 Kudos
alphacz
Level 5

I should say rather - this does what you want it do do; it performs the substitution.
0 Kudos
TonyLowrey
Level 3

Actually this is to support localisation of settings in a merge module so I have simplified it a little here.
The original string to be substituted is in a Property in the main installer which can be easily loclised via the string table.
I want to substitute the property embedded in the Localisable Property as I set it in the registry value. This setting is actually done inside a merge module but the principal is the same.
I have made the change which shows the error in the attached installer.
0 Kudos
munsingh
Level 6

Try creating a SetProperty custom action. It allows you to set the value of a property to another property.
0 Kudos