Uma,

Apologies for the delayed response.  If you haven't figured it out already,
you only need to remove the parent 'SnippetDir' node, and all of its
children will be removed with it.  However, you will need to be clever with
your XPath to make sure you select the correct 'SnippetDir' node for removal
-- e.g., reference something unique from the "More Stuff" part.

For example, something like this:

<util:XmlConfig On=&quot;uninstall&quot; Action=&quot;delete&quot;
Id=&quot;RemoveSnippetDir&quot;
    File=&quot;&lt;Path to Xml>\snippetsindex.xml"
    Node="element" ElementPath="//SnippetCollection//Language"
    VerifyPath="SnippetDir[\[]MoreStuff/@Foo='bar'[\]]" />

You should replace the MoreStuff/@Foo='bar' qualifier with something that
uniquely describes the SnippetDir that you're adding on installation. 
Remember that you need to use the "[\[]" and "[\]]" to escape the square
brackets that would otherwise be interpreted as MSI's "[PropertyName]"
syntax.

The XmlConfig Element documentation is not very clear on this point, but in
my experience, for a "delete element" action, ElementPath points to the
parent of the element you want to delete (so the same ElementPath you used
when creating it as Node="document"), VerifyPath is interpreted relative to
the ElementPath, and VerifyPath specifies what you want to delete.

(I didn't repeat the xmlns:util namespace declaration on the above example;
you should put this on a higher-level element in your file so that you don't
have to keep repeating it.)

Regards,
Mike


uharano wrote
> Hi Mike,
> I got the installation to work using the Node="document" method. The xml
> content is now correctly written during install mode.
> To remove the xml content during uninstall, I need to specify each node in
> a sequence (working from the child elements to outer elements), correct? I
> cannot use the Node="document" and pass the entire xml snippet?
> 
> Thanks!
> Uma





--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Help-with-adding-new-elements-using-XMLConfig-tp7593764p7594140.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to