This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- XML File Text Substitution
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 28, 2008
09:27 AM
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:
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!
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:
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!
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 28, 2008
03:45 PM
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.