I want to update my machine.config to create the <deployment> element in
system.web if and only if it does not already exist. Then I want to
update the retail attribute to be set to "true" no matter whether or not
the <deployment> element existed before the install began. Here is my
WiX snippet:

 

          <Component Id="MachineConfigUpdates" Guid
="{FA828AD3-4E9B-4f24-921B-93E755A2A487}" KeyPath="yes">

            <util:XmlConfig Id="MachineConfigAdd"
File="[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.c
onfig" Action="create" 

                ElementPath="//configuration/system.web"
Name="deployment" Node="element" Sequence="1" On="install" />

            <util:XmlConfig Id="MachineConfigKey"
File="[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.c
onfig"

                ElementPath="MachineConfigAdd" Name="retail"
Value="true" Sequence="2" />

          </Component>

 

The problem is that it creates another <deployment> element every time
the install begins. How can I fix this issue? I also tried adding a
delete at the beginning of this component. Even if this worked it would
not be ideal because it would eliminate any other attributes of the
<deployment> element that may already have been set.

 

Here is my snippet with the delete:

 

          <Component Id="Mss.MachineConfigUpdates" Guid
="{FA828AD3-4E9B-4f24-921B-93E755A2A487}" KeyPath="yes">

<util:XmlConfig Id="MachineConfigDelete"
File="[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.c
onfig" Action="delete" 

ElementPath="//configuration/system.web" Name="deployment"
Node="element" Sequence="1" On="install" />

            <util:XmlConfig Id="MachineConfigAdd"
File="[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.c
onfig" Action="create" 

                ElementPath="//configuration/system.web"
Name="deployment" Node="element" Sequence="2" On="install" />

            <util:XmlConfig Id="MachineConfigKey"
File="[WindowsFolder]Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.c
onfig"

                ElementPath="MachineConfigAdd" Name="retail"
Value="true" Sequence="3" />

          </Component>

 

In this case, the delete seems to be ignored and I get the same result:
multiple <deployment> elements in my machine config.

 

Any ideas?

 

Thanks.

 

 

-          Phil

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to