View Full Version : XML file changes altering other XML

07-03-2006, 09:40 AM
Hi, I have a basic MSI project to install a webservice. I need to alter the web.config file to have a valid connection string from user inputted values. I am using public properties and have imported the config file into the XML File Changes section of my project. I have only selected the element that I need to change. Further down in my web.config is the following xml

<clear />
<add namespace="System" />
<add namespace="System.Collections" />
<add namespace="System.Collections.Specialized" />
<add namespace="System.Configuration" />


this is not selected by me in the XML file changes section however when the file is installed it is changed to look like this:

<clear> </clear>
<add namespace="System"></add>
<add namespace="System.Collections"></add>
<add namespace="System.Collections.Specialized"></add>
<add namespace="System.Configuration"></add>

There are closing tags added. My webservice will not run with this xml only with the close tags as they are in the original web.config.

Why does installshield change XML even though I haven't selected it to be changed?


07-03-2006, 10:56 AM
Just noticed, I took a web.config file imported all elements, made no replacements and just wrote the contents to the install directory with no changes and it removes comments and changes the order or some elements. This is totally unnacceptable behaviour.

01-23-2009, 08:16 AM
I am having the exact same problem in IS2009. My problem is that the <clear /> element get changed to <clear></clear>. This causes problems when the web server tries to read the file. It also removes comments etc like you posted.

Anyone have a solution for this?

06-11-2010, 02:09 PM
I'm having this same issue in IS2009. Is there a solution for this?

06-11-2010, 04:30 PM
In InstallShield 2010, we added a new Format XML After Changes check box to the Advanced tab for an XML file in the XML File Changes view. This check box lets you specify whether you want the XML file to be formatted after the run-time changes are made to the file.

If you select this check box to indicate that the file should be formatted at run time, the installation adds indentations to the file and replaces empty-element tags with start tags and end tags. This matches the behavior that is available for XML changes made by InstallShield 2009 and earlier installations. If you do not want any of the formatting to occur, you would clear this check box.

So, you might want to consider upgrading to InstallShield 2010. I'm not aware of any workaround for the XML File Changes view in earlier versions of InstallShield.

06-29-2010, 02:40 AM
I'm using Installshield 2010, I want to delete full tag from my web.config. How do i go ahead.... in XML file Changes

More clarification...

I have following tag in my Web.Config

<add key="UseFile" value="true"/>
<add key="WelcomeText" value="Welcome to the system."/>

Now i want to remove <add key="UseFile" value="true"/> line or full <ADD> tag completely...

06-29-2010, 08:28 AM
Duplicate post; for follow-up, see http://community.flexerasoftware.com/showthread.php?t=193970.