A cosmetic bug, I should have changed the idea to match the activity. Something like DeleteAddElement.
-- John Merryweather Cooper Senior Software Engineer | Enterprise Service Applications | Continuing Development Jack Henry & Associates, Inc.® | Lenexa, KS 66214 | Ext: 431050 |jocoo...@jackhenry.com -----Original Message----- From: John Cooper Sent: Thursday, October 23, 2014 10:07 AM To: 'General discussion about the WiX toolset.' Subject: RE: [WiX-users] Is it possible to delete the Key/value pair from web.config file during installation. I would use util:XmlConfig as it is far more powerful than util:XmlFile for this problem. <util:XmlConfig Id="CreateFirstAddElement" Action="delete" ElementPath="/configuration/product/Deploy/Servers" File="[#FileWebConfig]" Name="add" Node="element" On="install" Sequence="1" VerifyPath="/configuration/product/Deploy/Servers/add[\[]@key='[SERVER]'[\]]" /> In this example the code looks for an "add" element at XPAT /configuration/product/Deploy/Servers, and if the key matches the value in the SERVER property, it deletes it. -- John Merryweather Cooper Senior Software Engineer | Enterprise Service Applications | Continuing Development Jack Henry & Associates, Inc.® | Lenexa, KS 66214 | Ext: 431050 |jocoo...@jackhenry.com -----Original Message----- From: Bala [mailto:balakrish...@ameexusa.com] Sent: Thursday, October 23, 2014 9:56 AM To: 'General discussion about the WiX toolset.' Subject: Re: [WiX-users] Is it possible to delete the Key/value pair from web.config file during installation. Yes, I WANT TO REMOVE the whole <add/> element. -----Original Message----- From: John Cooper [mailto:jocoo...@jackhenry.com] Sent: 23 October 2014 19:44 To: General discussion about the WiX toolset. Subject: Re: [WiX-users] Is it possible to delete the Key/value pair from web.config file during installation. So, to be clear, you want to remove the whole <add/> element? -- John Merryweather Cooper Senior Software Engineer | Enterprise Service Applications | Continuing Development Jack Henry & Associates, Inc.® | Lenexa, KS 66214 | Ext: 431050 |jocoo...@jackhenry.com -----Original Message----- From: Bala [mailto:balakrish...@ameexusa.com] Sent: Thursday, October 23, 2014 9:10 AM To: 'General discussion about the WiX toolset.' Subject: Re: [WiX-users] Is it possible to delete the Key/value pair from web.config file during installation. Hi Carter, Thanks for your reply. I have gone through the link you provided. But it will delete the attribute value only it will not remove the entire Key. I want to remove the entire key from the web.config. Thanks Bala -----Original Message----- From: Carter Young [mailto:ecyo...@grandecom.net] Sent: 23 October 2014 19:32 To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] Is it possible to delete the Key/value pair from web.config file during installation. Please read this Blog Post: http://blogs.technet.com/b/alexshev/archive/2009/05/27/from-msi-to-wix-part- 25-installable-items-updating-xml-files-using-xmlfile.aspx Even though this post refers to app.config, the same principles apply to web.config Quoting Bala <balakrish...@ameexusa.com>: > Hi, > > > > Is it possible to delete the Key/value pair from web.config file > during installation. > > > > I am able to add new key/value pair during the installation through > the below code. > > <util:XmlFile Id='conf1' Action="createElement" > ElementPath="/configuration/appSettings" Name="add" > File="[$(var.ConfigFileID)]" Sequence="1" /> > > <util:XmlFile Id='conf2' Action="setValue" > ElementPath="/configuration/appSettings/add[\[]not(@key)[\]]" Name="key" > Value="ClientName" File="[$(var.ConfigFileID)]" Sequence="2" /> > > <util:XmlFile Id='conf3' Action="setValue" > ElementPath="/configuration/appSettings/add[\[]@key='ClientName'[\]]" > Name="value" Value="[CLIENTNAME]" File="[$(var.ConfigFileID)]" Sequence="3" > /> ---------------------------------------------------------------------------- -- _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ---------------------------------------------------------------------------- -- _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies. ---------------------------------------------------------------------------- -- _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies. ------------------------------------------------------------------------------ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users