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/[EMAIL PROTECTED]'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/[EMAIL PROTECTED]'newSection'
[\]]"
VerifyPath="/configuration/configSections/[EMAIL PROTECTED]'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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to