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)?
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)
Please log in to answer
Posted by:
pjgeutjens
14 years ago
Stephen,
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
PJ
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
PJ
Posted by:
timmsie
14 years ago
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
cheers
Rich
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
cheers
Rich
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.