Help! Updating a .NET config XML file. - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

nemity
Posts: 3
Joined: Thu Dec 06, 2007 4:10 pm

Help! Updating a .NET config XML file.

Hi,

I am trying to get my AI 6.2 to update an exisiting .NET config file with new keys, but I'm having no luck.

My current .NET config file look like this :

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
       <add key="IdentityDescription" value="Test Server A" />
       <add key="GridLocation" value="R" />
       <add key="OneStepSQL-LIVE" value="server = ND-SQL-SERVER"
      <add key="ActiveMarkerFile" value="\\nd-dc-rainham\dev\Markers\" />
      <add key="ReportMaster" value="0" />
      <add key="MailServer" value="mail.nexdox.com" />
      <add key="MailFrom" value="onestep@nexdox.com" />
      <add key="MailErrors" value="julian@nexdox.com" />
      <add key="ScanPeriod" value="10000" />
    </appSettings>
</configuration>
Because some of these fields need to be populated according to specific machine specs during install, as part of my install setup I imported the config file as an XML file. The screen for my config file looks like this :

Image

As you can see there are 9 "add" elements in the config file, and 10 "add" elements in the config screen. The extra element in the install routine is :

Code: Select all

      <add key="SMSHours" value="" />
As part of the install, I want to update the config file with this 10th "add" element. Currently it is not changing anything in the config file. So my settings in the edit XML screen must be wrong. Perhaps you could tell me what I should be setting for each of the node levels to allow it to update correctly?

Thanks.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Most likely the AIP is not configured correctly for this XML. Please send us the AIP with the XML you are using or a small test case which reproduces this behavior to support at advancedinstaller dot com so we can investigate it.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Since your elements have the same name, a new element you want to add to the XML must have an identifier attribute. For this you can select the element, go to the "Attributes" tab, double-click the first attribute and check the "Is identifier attribute" option.

You can read more about this here:
http://www.advancedinstaller.com/user-g ... ialog.html

Also, in order to leave the element unchanged if it is found you can simply uncheck the "If the element is found" option in the "Element Settings" tab.
http://www.advancedinstaller.com/user-g ... tings.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”