adam@ibexuk.com
Posts: 10
Joined: Wed Jun 16, 2010 5:53 pm

Read config from XML file on upgrade

I'm using advanced installer to save various coniguration settings during install to an XML file that my applicaiton can then read. All relatively simple to setup using advanced installer. To avoid users having to enter the same information again every time there is an upgrade I need to find a way for advanced installer to read its previoulsy created xml file entries (which is set to be retaned on un-install) and load the various global parameters from it, or keep with the default parameter values if it can't.

After a pretty extensive search I can't see a way of easily doing this. If it's still the case that advanced installer can't natively do this are there any examples of working custom actions available that do it? I've found a couple of similar old posts with a similar problem and the stock answer seems to be that it can be done using a custom action and a vbscript. From my research that doesn't appear to be a particuarly simple task as I've not been able to find a single example of it, let alone one that is solid and good to use. Surely this must be a relatively common problem that lots of users come up against?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Read config from XML file on upgrade

Hi Adam,

You can use a backup/restore method to prevent the XML configuration file from being replaced by the upgrade like shown in the user guide.

During the upgrade process, you can ask the user if he wants to preserve the configuration file from the already installed product. He can choose yes in which case you don't ask him for new information, or he can choose no in which case you display the dialog in which he can input his settings.

You can then execute the backup/restore script conditionally, depending on what the user selected (keep the file from previous install or replace it)

Actually reading settings from the XML is not directly supported, you will need to write your own custom action. I suggested the above in hope that it's an easier yet reasonable approach.

Let me know if it helped.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
adam@ibexuk.com
Posts: 10
Joined: Wed Jun 16, 2010 5:53 pm

Re: Read config from XML file on upgrade

OK thanks, that is a good comprimise solution I hadn't considered, although the link you gave is an increadibly complex way of acheiving it. I have instead simply marked the file to be retained and do a custom action search to see if it is there or not.

Return to “Common Problems”