Reading values from ini or XML answer 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!

bilby001
Posts: 8
Joined: Mon Apr 11, 2011 12:12 am

Reading values from ini or XML answer file

Hi, I need to know how to read and parse an ini or XML file to populate edit fields. I have edit fields in dialogue pages which are populating application ini files in the app. I'm also writing the properties to an ini file and an XML file in the course of the installation as an answer file to prepopulate edit fields in subsequent server installations in the domain, the user can accept or change the suggested field value during subsequent installs. If there is no value then the field is blank. I'm not sure whether I'll use an ini or XML file for the answer file, depends which is easier/possible.

I plan to ask the user to browse for the answer file to get the path, then read the key/value pairs from the file. My question is how do I read the key/value pairs from an ini or XML file which isn't part of the installation? This would be a custom action, but are there any tutorials/examples of how to set up this custom action, including vbscript examples?

Thanks
Russell Schneider
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Reading values from ini or XML answer file

Hi Russell and welcome to the Advanced Installer Forums,
This would be a custom action, but are there any tutorials/examples of how to set up this custom action, including vbscript examples?
Indeed you would need to implement this functionality from within your own custom action but unfortunately we don't have any vbscript samples to get you started with this. However, you can still search the internet for an optimal solution on how to parse the .XML file at install time.

Starting with our latest version, we included a predefined functionality close to what you need, named XML Locator. However by using this feature you will not be able to permit the user choose the .XML file's location. The location can be set only at build time. Here is the tutorial that describes this feature.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bilby001
Posts: 8
Joined: Mon Apr 11, 2011 12:12 am

Re: Reading values from ini or XML answer file

Thanks Mihai, setting a hardcoded location shouldn't be a problem. I'll have a look at the tutorial.

Thanks for your prompt reply.

Cheers
Russell
bilby001
Posts: 8
Joined: Mon Apr 11, 2011 12:12 am

Re: Reading values from ini or XML answer file

Excellent, works like a charm. Thanks for your help.

Our company has struggled to get WISE and other installers to work without a massive investment in courses, time and money. Within one week of using Advanced Installer one person was able to produce a working installation package of our installation process (IIS, databases, PHP, ini's, registry entries, user input and services) basically working in his spare time. It looks like we'll be buying AI. An excellent product.

Cheers
Russell

Return to “Common Problems”