Creating an XML File Reference

InstallShield 2020

Project:This information applies to the following project types:

Basic MSI
DIM
InstallScript
InstallScript MSI
Merge Module
MSI Database
Transform

The recommended way to add an XML file that you want to modify at run time is to add the base XML file to a component in your project through the Files and Folders view. Then add an XML file reference to the XML File Changes view, where you can specify the changes that should be made to that file at run time. The easiest way to add the XML file reference is to import the file into the XML File Changes view.

Important:The XML File Changes view is not designed to list a node for every node in an XML file. To improve performance, the XML File Changes view should show only the settings that differ from the base XML file:

If the XML file that you are modifying is part of your installation, the XML File Changes view should list only the nodes and node sets that should be added, changed, or deleted after the XML file is installed at run time.
If the XML file that you are modifying is a file that is already present on the target system, the XML File Changes view should list only the nodes and node sets that need to be added, changed, or deleted at run time.

Therefore, when you are importing a file, import only the nodes in the XML file that you want to modify at run time.

Note that the XML File Changes view does not enable you to specify the order in which new elements should be listed in the XML file. Therefore, importing only the nodes that you want to modify at run time helps to avoid issues that may occur if your product requires that the elements be listed in a particular order.

To import an XML file into the XML File Changes view:

1. In the View List under System Configuration, click XML File Changes.
2. Right-click the XML Files explorer and then click Import. The Import XML Settings Wizard opens.
3. Complete the panels in the wizard, selecting only the XML file nodes that you want to change.
4. Click Import.

InstallShield adds a new node for the XML file that you imported. The XML file node contains each of the nodes that you selected in the wizard. Each node represents an XPath query that occurs at run time. InstallShield also adds a new component for the XML file that you have imported through the XML File Changes view.

Now you can configure the XML file’s settings and specify any element, attribute, and content changes for it.

Tip:You can also add an XML file by right-clicking the XML Files explorer and then clicking New File. However, in most cases, you may want to create your XML file in a third-party XML editor or text editor. Next, add this file to your project through the Files and Folders view. Then, import the file, as described in the aforementioned procedure, and configure the changes that should be made to the file at run time.

See Also