Andre Strik
2007-04-19 05:11:43 UTC
Hi all,
Has anyone successfully used util:XmlConfig to modify an XML file on
uninstall?
Adding nodes is working, but removing them on uninstall is still beyond
me. Even with the VerifyPath attribute set, I'm still having no joy.
The below component successfully adds a <section> tag to a web.config,
but leaves it behind on uninstall.
<Component Id="XmlAddSection"
Guid="EB9B4575-467C-4BFB-ACA7-7C3E472A610F" KeyPath="yes">
<CreateFolder/>
<util:XmlConfig Id="XmlAddSectionDeclaration"
File="[DirWebInterfaces]web.config" Sequence="1" Action="create"
On="install" ElementPath="/configuration/configSections" Node="element"
Name="section"
VerifyPath="/configuration/configSections/section[\[]@name='newSection'[
\]]" />
<util:XmlConfig
Id="XmlAddSectionDeclarationName" File="[DirWebInterfaces]web.config"
Sequence="2" ElementPath="XmlAddSectionDeclaration" Name="name"
Value="newSection" >
<util:XmlConfig
Id="XmlAddSectionDeclarationType" File="[DirWebInterfaces]web.config"
Sequence="3" ElementPath="XmlAddSectionDeclaration" Name="type"
Value="blah" />
</util:XmlConfig>
<!-- This bit isn't working -->
<util:XmlConfig Id="XmlRemoveSectionDeclaration"
File="[DirWebInterfaces]web.config" Sequence="1" Action="delete"
On="uninstall" Node="element"
ElementPath="/configuration/configSections/section[\[]@name='newSection'
[\]]"
VerifyPath="/configuration/configSections/section[\[]@name='newSection'
[\]]"/>
</Component>
In the uninstall log, I see this:
ExecXmlConfig: Error 0x80070057: failed to remove created child element
That HR is something to do with an invalid character I believe?
Thanks,
Andre
Has anyone successfully used util:XmlConfig to modify an XML file on
uninstall?
Adding nodes is working, but removing them on uninstall is still beyond
me. Even with the VerifyPath attribute set, I'm still having no joy.
The below component successfully adds a <section> tag to a web.config,
but leaves it behind on uninstall.
<Component Id="XmlAddSection"
Guid="EB9B4575-467C-4BFB-ACA7-7C3E472A610F" KeyPath="yes">
<CreateFolder/>
<util:XmlConfig Id="XmlAddSectionDeclaration"
File="[DirWebInterfaces]web.config" Sequence="1" Action="create"
On="install" ElementPath="/configuration/configSections" Node="element"
Name="section"
VerifyPath="/configuration/configSections/section[\[]@name='newSection'[
\]]" />
<util:XmlConfig
Id="XmlAddSectionDeclarationName" File="[DirWebInterfaces]web.config"
Sequence="2" ElementPath="XmlAddSectionDeclaration" Name="name"
Value="newSection" >
<util:XmlConfig
Id="XmlAddSectionDeclarationType" File="[DirWebInterfaces]web.config"
Sequence="3" ElementPath="XmlAddSectionDeclaration" Name="type"
Value="blah" />
</util:XmlConfig>
<!-- This bit isn't working -->
<util:XmlConfig Id="XmlRemoveSectionDeclaration"
File="[DirWebInterfaces]web.config" Sequence="1" Action="delete"
On="uninstall" Node="element"
ElementPath="/configuration/configSections/section[\[]@name='newSection'
[\]]"
VerifyPath="/configuration/configSections/section[\[]@name='newSection'
[\]]"/>
</Component>
In the uninstall log, I see this:
ExecXmlConfig: Error 0x80070057: failed to remove created child element
That HR is something to do with an invalid character I believe?
Thanks,
Andre