I knew that would happen. Solved it just after posting...

 

It looks like for an uninstall action, the @ElementPath points to the
parent node, while the @VerifyPath is relative to the @ElementPath.

 

So this works:

 

<util:XmlConfig Id="XmlRemoveSectionDeclaration"
File="[DirWebInterfaces]web.config" Sequence="1" Action="delete"
On="uninstall" Node="element"
ElementPath="/configuration/configSections"
VerifyPath="[EMAIL PROTECTED]'newSection'[\]]"/>

 

Cheers,

 

Andre

 

 

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andre
Strik
Sent: Thursday, 19 April 2007 5:12 p.m.
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] XmlConfig and uninstall

 

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