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
- :
- Re: Changing values in XML file
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
‎Nov 10, 2009
12:28 PM
Changing values in XML file
I have an app.config file which I need too change some values in.
I have read the section in the helpfile called:
Using InstallScript Text Substitution to Dynamically Modify XML Files
But I cannot get this to work. I created an entry in the string table called:
ID_AUTOMATIC_FLAG and set it to True.
In the XML File Changes view I then go to the element properties advanced tab and try and reference this with, this ends up changing to {ID_STRING50}
In my script I then use
TextSubSetValue(@ID_AUTOMATIC_FLAG, "False", TRUE);
The substitution in my xml file always ends up with something like
<ID_AUTOMATIC_FLAG>
I have also tried this syntax
TextSubSetValue(, "False", TRUE);
but that does not appear to work either
Could someone clarify how this is supposed to work, the main problem appears to be in setting the element content, it does not appear to recognise the string table value, I have tried numerous variations, enclosing it in quaotes, using [] brackets but nothing seems to work.
I have read the section in the helpfile called:
Using InstallScript Text Substitution to Dynamically Modify XML Files
But I cannot get this to work. I created an entry in the string table called:
ID_AUTOMATIC_FLAG and set it to True.
In the XML File Changes view I then go to the element properties advanced tab and try and reference this with
In my script I then use
TextSubSetValue(@ID_AUTOMATIC_FLAG, "False", TRUE);
The substitution in my xml file always ends up with something like
I have also tried this syntax
TextSubSetValue(
but that does not appear to work either
Could someone clarify how this is supposed to work, the main problem appears to be in setting the element content, it does not appear to recognise the string table value, I have tried numerous variations, enclosing it in quaotes, using [] brackets but nothing seems to work.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2009
08:55 AM
Have you tried this?
TextSubSetValue("", "False", TRUE);
(where the first parameter is in quotes?)
TextSubSetValue("
(where the first parameter is in quotes?)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 15, 2009
08:02 AM
Hi,
I had tried the quotes without success, if I debug the package I can see the script reach the line:
TextSubSetValue("","MyValue",TRUE);
But the value in the xml file never changes.
If I look at the set element content property in the advanced tab of the XML Element you can see:
{MyProperty}False
But the value in the file never changes, even though if I debug the script I can see the line TextSubSetValue("","MyValue",TRUE); being called. I know at the point that the line is called the file modification date changes, it just does not put the new value in the file.
I had tried the quotes without success, if I debug the package I can see the script reach the line:
TextSubSetValue("
But the value in the xml file never changes.
If I look at the set element content property in the advanced tab of the XML Element you can see:
{MyProperty}False
But the value in the file never changes, even though if I debug the script I can see the line TextSubSetValue("
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 17, 2009
04:59 PM
Where in your code are you calling TextSubSetValue? Is it possible that your code is being called before the XML file is installed on the target system?
A common place for the TextSubSetValue call is the OnFirstUIBefore event.
A common place for the TextSubSetValue call is the OnFirstUIBefore event.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)