Hi Phillip,

Just try using "ElementId" while creatinf attributes of an element. You don't 
need to create anther depoyment element, just refer it by using "ElementId".

For Deletion on Un-install, you need to specify "On=Uninstall" attribute to 
XMLConfig.

Hope this help

Thanks
Jaspreet Ssingh


________________________________________
From: phillip_sid...@dellteam.com [phillip_sid...@dellteam.com]
Sent: Wednesday, September 16, 2009 11:36 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Creating or Updating an Xml Element

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

***The information transmitted is intended only for the person or entity to 
which it is addressed and may contain confidential and/or privileged material. 
Any review,retransmission,dissemination or other use of, or taking of any 
action in reliance upon, this information by persons or entities other than the 
intended recipient is prohibited. If you received this in error, please contact 
the sender and delete the material from any computer.***

------------------------------------------------------------------------------
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