How to create an MSI that has multiple versions of a single to install based on a condition

Hello All,

I have an application that has four XML configuration files that need to be installed.
There are a two of these files that have four different versions that need to be installed on the same location depending on a condition. for example ConfigFile1.xml needs to be copied to C:\Program Files\Amce\Configuration directory. The four different versions have to be named the same when copied to this location.

Can I create an MSI that can contain all four versions of this same ConfigFile1.xml and controll which version is installed based on a condition (the condition I was thinking was a Property which can be passed at execution of this MSI)?

0 Comments   [ + ] Show comments

Answers (2)

Posted by: pjgeutjens 12 years ago
Red Belt

you can do this in 2 ways. Easiest way is to include 4 components in your MSI, each containing a version of the XML file. You then put the correct condition on the components like MYPROPERTY="PROD" / MYPROPERTY="UAT" (I'm guessing but you catch my drift).

The second slightly more complicated option is to make different top-level features in your msi, each containing a component for one XML file. You can then condition the features' installlevels to drop below the MSI's INSTALLEVEL property with pretty much the same conditions as above. make their default installevel higher than the INSTALLLEVEL property.

3 thing to keep in mind:
1) make sure you put some thought into the conditions, might want to use the ~ operator to make em case insensitive (MYPROPERTY ~= "PROD")
2) you'll have to pass the property on the command line when installing. Might be a good idea to put a "default" value in your package. You'll also wanna catch typos..
3) personally I'd treat the XML files as files, and not use any 'fancy' XML changing tables and the like

Hope this helps

Posted by: timmsie 12 years ago
Fourth Degree Brown Belt
If your using wise you could use the "Dynamic content" feature with your xml file.

So you add one xml file and set properties for the elements you want to change.

Depending on conditions set the property values to whatever you need and bobs your uncle.

Alternatively you could use the solution described above I think you'll get validation errors adding the same file though you'd have to use the duplicate file table

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ