Friday, 18 January 2013

How to Use InstallShield XML Files Changes

Forget the designer and how it tries to make you work, you need to think in terms of XPath queries to get to the element you're looking for. The tree view represents the XPath expression to find existing items, not a typical treeview of an XML file. Here are the steps I used to successfully manage my config file changes.

1. Create a component for your existing development XML file and include the XML file in it. Set all of the attributes for the file properly (key file, target location, etc.)

2. Switch to XML view and use the import wizard. Only import the keys you want to change

3. Once the wizard is done, select the file itself and set the XML File Destination to match the XML file you're modifying.

4. Change the search patterns for the keys you want to modify. For some reason, the IDE shows this as the Element Name - this is actually the XPath query to find the element. In my case, I have one key in my config for the database. The "Element Name" in XML changes view is 'add[@key="Database"]'. In other words, remove the 'value' part.

5. Delete anything in the attributes section that you aren't trying to change (in my case, the 'value' attribute is the only one I left)

6. Set the Value of your attribute as necessary (I use [SQLDATABASE] - my own database Property) and set the operation to Append Value.

7. Switch to advanced view and make sure that only "Update first matching element only" is checked (unless you want to replace multiple, identical elements - but then you have other fish to fry)

8. I don't know if this is strickly necessary but I'm a bit nutty when it comes to how clean my installs must be - I use the Direct Editor a lot trying to clean up the garbage that the wizards leave lying around. Go to Direct Editor and choose the ISXmlFile table, change the Component of your file to the Component that houses the XML file from step

9. Now go back to component view and delete the extra, blank component that the XML changes wizard created.

Found at:

No comments:

Post a Comment