[wix-users] Remove Entire XML Node

Brian Enderle brianke at gmail.com
Fri Aug 21 10:30:56 PDT 2015


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


More information about the wix-users mailing list