Modifying 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

Modifying XML File

I have the following XML file with the following contents. It is a .NET config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="SystemPath" value="\\%COMPUTERNAME%\PROCESS\System\" />
</appSettings>
</configuration>

I need to essentially be able to replace %COMPUTERNAME% to the real value.

Can I use the XML editor to do this?...results have not been good from my attempts.

Can I just write the whole file out as is from scratch, replacing the value during the write?

Can I do a find and replace on this as an existing file..

Thanks in advance.
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

Yes you can achieve what you want using Advanced Installer's XML support.

1. Import the XML file in Advanced Installer and open it in the XML editor.
2. Select the "add" element and switch to the Attributes tab.
3. Edit the "value" attribute and instead of %COMPUTERNAME% enter [ComputerName]. This is a Windows Installer property which will be evaluated to the the computer name of the target system.
Can I just write the whole file out as is from scratch, replacing the value during the write?

Can I do a find and replace on this as an existing file..
Yes you can both create the XML file from scratch or update it if already exiting on the target machine.

For more details please see:
http://www.advancedinstaller.com/user-g ... files.html

Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
nemity
Posts: 3
Joined: Thu Dec 06, 2007 4:10 pm

Thanks, that worked!

The only thing I would suggest is that you perhaps should treat extensions like .exe.config and .web.config as standard XML and offer the import XML wizard dialog when you come across these by default.

I was able to import them but only by selecting All Files from the manual Import XML dialog and picking my exe.config file. I thought the Import XML menu item was ONLY for XML files.

Thanks though!
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Thanks for your suggestions. We will consider them in the next revision.

Regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”