XmlFile Element

WiX Help

XmlFile Element

Description

Adds or removes .xml file entries. If you use the XmlFile element you must link with wixca.wixlib because it requires the XmlFile custom actions.

Windows Installer references
None
Parents
Component
Inner Text
None
Children
None
Attributes
Name Type Description Required
Id String Identifier for xml file modification. Yes
Action Enumeration The type of modification to be made to the XML file when the component is installed. This attribute's value should be one of the following:
createElement
Creates a new element under the element specified in ElementPath. The Name attribute is required in this case and specifies the name of the new element. The Value attribute is not necessary when createElement is specified as the action. If the Value attribute is set, it will cause the new element's text value to be set.
deleteValue
Deletes a value from the element specified in the ElementPath. If Name is specified, the attribute with that name is deleted. If Name is not specified, the text value of the element specified in the ElementPath is deleted. The Value attribute is ignored if deleteValue is the action specified.
setValue
Sets a value in the element specified in the ElementPath. If Name is specified, and attribute with that name is set to the value specified in Value. If Name is not specified, the text value of the element is set. Value is a required attribute if setValue is the action specified.
Yes
CreateElement YesNoType Specifies whether or not to create an Element with the name specified in the Name attribute.  
ElementPath String The XPath of the element to be modified. Note that this is a formatted field and therefore, square brackets in the XPath must be escapted. Yes
File String Path of the .xml file to configure. Yes
Name String Name of XML node to set/add to the specified element. Not setting this attribute causes the element's text value to be set. Otherwise this specified the attribute name that is set.  
Permanent YesNoType Specifies whether or not the modification should be removed on uninstall. This has no effect on uninstall if the action was deleteValue.  
Sequence Integer Specifies the order in which the modification is to be attempted on the XML file. It is important to ensure that new elements are created before you attempt to add an attribute to them.  
Value String The value to be written.  
See Also
Wix Schema