visualsi
Posts: 40
Joined: Fri Oct 14, 2011 4:16 pm

Conditions in XML Files

It appears that there isn't a facility to set up XML files differently depending on choices that users have made while answering questions in dialog boxes - or at least there doesn't seem to be an easy way to do it.

For example, something as simple as connection strings for SQL Server databases... They look different depending on whether the user chooses to implement a single node database instance, a mirrored database or an AlwaysOn Availability Group. It would be nice to be able to ask the user how the database is implemented, have them browse for servers and databases, then in the XML file, have it test the implementation type and use that to create a usable connection string.

This one is doable by text substitution since all of them need something similar but different, but it easily gets very clumsy when entire sections need to be included based on choices made in the dialogs.

(how to do it)

We ask the implementation type before we ask for server names, etc., and we have a final "verify all your choices" screen before we do the install. Attached to the "Install" button on the "Verify" screen, we create a "DB_SERVER_CONNECT_PART" string which might end up looking like "Data Source=SCRAPPLE;Failover Partner=VEGEMITE" based on the choices made during the dialogs. If it were a single database server solution, the string might be set to something like "Data Source=HAGGIS". In the XML file, this would get substituted where the database server name would go in the connect string.

(the problem)

What do you do when it gets more complex, as in you need to leave out or add in an entire section based on options selected?
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Conditions in XML Files

Hello,

Currently we don't have an option to condition the installation of a specific element from the XML file. You can condition only the entire XML file by using a condition on its associated component from "Organization" page. However, we already added this improvement on our TODO list and hopefully it will be available soon. We'll update this thread as soon as the improvement will be out.

Until then, you can try to use a similar workaround like is exposed in our "Xml Edit conditional operations" thread.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Conditions in XML Files

Hello,

This improvement has been added in version 12.2 of Advanced Installer released on June 10th, 2015.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”