[wix-users] Remove Entire XML Node
James Buchan
James.Buchan at tribalgroup.com
Fri Aug 21 14:21:29 PDT 2015
It looks like you are missing a "VerifyPath" element (It is mandatory for delete actions)
http://wixtoolset.org/documentation/manual/v3/xsd/util/xmlconfig.html
Here's a snippet of something I have been using
<util:XmlConfig
Id="RSWebConfigConfigSectionUninstall"
File="[INSTALLLOCATION]web.config"
Action="delete"
Node="element"
VerifyPath="//configuration/configSections"
ElementPath="//configuration"
On="uninstall"
Sequence="1" />
You don't need to delete the individual child nodes, just aim for the parent.
James
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Brian Enderle
Sent: 21 August 2015 18:31
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Remove Entire XML Node
I have the following XML:
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*"
path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd"
preCondition="integratedMode"
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="svc-Integrated" verb="*" path="*.svc"
preCondition="integratedMode"
type="System.ServiceModel.Activation.HttpHandler"/>
</handlers>
<staticContent>
<mimeMap fileExtension=".svc" mimeType="application/octet-stream"/>
</staticContent>
</system.webServer>
</configuration>
I have a condition that when applicable I would like to remove the node <staticContent> and its child node <mimeMap>
I have tried:
<util:XmlConfig Id="UpdateMimeMap"
Action="delete"
On="install"
File="[#WebConfig]"
ElementPath="/configuration/system.webServer/staticContent"
Node="element"
PreserveModifiedDate='yes'
Sequence="3">
</util:XmlConfig>
But this errors out during install with the message:
ExecXmlConfig: Error 0x80070057: failed to remove created child element CustomAction ExecXmlConfig returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Is there a way I can delete the node and child node or do I have to delete the child first, then the parent node? Or is my delete call incorrect somehow?
Brian
If you can't explain it simply, you don't understand it well enough. - Albert Einstein
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
Information contained in this e-mail is intended for the use of the addressee only, is confidential and may be the subject of Legal Professional Privilege. Any dissemination, distribution, copying or use of this communication without our prior permission or that of the addressee is strictly prohibited.
The contents of an attachment to this e-mail may contain software viruses, which could damage your own computer system. While Tribal has taken every reasonable precaution to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should carry out your own virus checks before opening the attachment.
More information about the wix-users
mailing list