Loading
XML File Text Substitution
Hi all,

 

I've spent all morning trying to figure out how to do a simple XML change, but have had no luck thus far. I hope someone can explain to me the steps I need to take to accomplish what I need. So, thanks in advance.

 

Very simply, I'm installing a file called x.config containing:

 

 

&ltadd name="DatabaseInformation"

 

providerName="System.Data.SqlClient"

 

connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=data;Integrated Security=True" />

 

 

On the fly, I need to simply change the "SQLEXPRESS" text to a variable value I read from an ini file, for example "hello"; So, I read from the ini during the install, get the value, and then need to write it to the XML file in the line above.

 

This is within an InstallScript project.

 

Can anyone help? I've not playes with XML files before.

 

Thanks!

  • If you are running an installation that runs Install Shield script, then check out this link . I wrote a function that will open up an XML file like web.config and make changes to it by using XML Document COM objects.

Loading
XML File Text Substitution