Got this working using the utils:XmlFile excerpt shown below.   Here are a 
couple of related questions now that the basic functionality is working.

q1 - is there any way to define that the util:XmlFile processing only occurs if 
a property value equals a given string, e.g. ENVIRONMENTID=Production

q2 - are there specific use cases when one should be using utils:XmlFile and 
others when one should be using utils:XmlConfig or is there lots of overlap in 
the services these elements are meant to provide?

<File Id="MyTool1.exe.config" Name="MyTool1.exe.config" 
Source="$(var.MyTool1.TargetPath).config" />

<util:XmlFile Id="Tool1IEventingServiceEndpointAddress" 
File="[#MyTool1.exe.config]"
    ElementPath="/configuration/system.serviceModel/client/[EMAIL 
PROTECTED]&quot;WSHttpBinding_IMyWcfService&quot;[\]]"
    Name="address" Value="[MyWcfServiceUrl]" Action="setValue" />

From: Robert O'Brien
Sent: Friday, May 16, 2008 11:14 AM
To: 'wix-users@lists.sourceforge.net'
Subject: XmlConfig setting I should use to replace just the address attribute 
value in the following parts of an app.config using a public property defined 
value?

Any tips on the XmlConfig setting I should use to replace just the address 
attribute value in the following parts of an app.config using a public property 
defined value?

I'm thinking something like the following based on the samples provided for 
using XmlConfig but am concernted that I'm trying to delete and replace a block 
of xml when there may be an option to just replace the "address" attribute 
which is really the only thing I need to change on a per deployment case.

Product.wxs
<File Id="MyTool1.exe.config" Name="MyTool1.exe.config" 
Source="$(var.MyTool1.TargetPath).config" />

<util:XmlConfig Id="Tool1IMyWcfServiceEndpointDelete" 
File="[#MyTool1.exe.config]"
    ElementPath="/configuration/system.serviceModel/client/endpoint"
    VerifyPath="/configuration/system.serviceModel/client/[EMAIL 
PROTECTED]&quot;WSHttpBinding_IMyWcfService&quot;[\]]"
    Name="Child" Action="delete" Node="element" On="install" Sequence="1" />

<util:XmlConfig Id="Tool1IMyWcfServiceEndpointCreate" 
File="[#MyTool1.exe.config]"
    ElementPath="/configuration/system.serviceModel/client/endpoint"
    VerifyPath="/configuration/system.serviceModel/client/[EMAIL 
PROTECTED]&quot;WSHttpBinding_IMyWcfService&quot;[\]]"
    Name="Child" Value="[IMYWCFSERVICEENDPOINT]" Action="create" Node="element" 
On="install" Sequence="1" />

MyTool1.exe.Config
<configuration>
    . .  .
    <system.serviceModel>
<client>
            <endpoint address="https://localhost/MyWcfService/MyWcfService.svc";
                binding="wsHttpBinding" 
bindingConfiguration="WSHttpBinding_IMyWcfService"
                contract="ServiceReference1.IMyWcfService" 
name="WSHttpBinding_IMyWcfService">
            </endpoint>
            <endpoint 
address="https://localhost/MyOtherWcfService/MyOtherWcfService.svc";
                binding="wsHttpBinding" 
bindingConfiguration="WSHttpBinding_IMyOtherWcfService"
                contract="ServiceReference2.IMyOtherWcfService" 
name="WSHttpBinding_IMyOtherWcfService">
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to