I'm creating an installation package for a service using the WIX Toolset. The installation package is working for simple xml replace but I'm unable to replace values where I have multiple nodes with the "same" path. Example xml config:
<service name="service1">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:1234/service1" />
</baseAddresses>
</host>
</service>
<service name="service2">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:1234/service2/" />
</baseAddresses>
</host>
</service>
Is there a simple way to replace "1234", during install, in all of the nodes using WIX (1234 is unique in the xml file)? If so, how?
If not, how can i target a specific service node? My guess is the ElementPath? I have a property [newPortValue] which contains the correct value.
<Component Id="xmlReplacerForService2" Guid="...">
<util:XmlFile
Id="xmlReplacerForService2"
Action="setValue"
File="[TESTFILEPRODUCTDIR]service.exe.config"
SelectionLanguage="XPath"
Permanent="yes"
ElementPath="/service?WhatToAdd?"
Name="baseAddress"
Value="net.tcp://localhost:[newPortValue]/service2" />
</Component>
Is this possible?