This has to be a common need yet I find hardly ANY references to it on the web...
I've got a product that has three sets of components, one installed on the server, one on the web head, and one on the developer's machine. All three sets could be installed on one machine and should peacefully coexist.
As I had it yesterday, each component was installing to a different place and working ok, but that was just temporary as some files, gac'd assemblies, and registry settings ought to be shared. Now I've made a merge module out of the shared components and this new merge-module scenario is working fine during install under ideal conditions and I've got major upgrades of a single msi all figured out.
The problem is during installation of an msi when the version of the merge module within the installing msi is lower than that of the already installed version (of a different msi) - the newer version is overwritten with the older version! Furthermore, upon un-installation routine of any of the three msis, the shared stuff is removed even though it is still in use by the other installed components.
For the most part I understand why I'm getting this behavior, but I don't understand how I'm supposed to be configuring my installers so that these components can be shared WITHOUT having a separate installer for the shared components. Also, I don't want one big installer either - this won't scale well.
What I want is that the three installers contain whatever latest version of the components in the merge module were available at build-time. At install time, if a newer version of the shared components is installed, don't overwrite them. At uninstall(and upgrade) time, the reference counts that should have been tracked would determine whether the shared items should be removed.
In case I'm just missing something, here are the important parts of the merge file: My merge module's version number (the y in "w.x.y") is incremented with each build, the package ID remains fixed, and each component has Shared="yes"
(although I've tried it without this as well).
I've started storing the various version numbers in the registry, and I figured maybe I could conditionally install the merge module feature only if the version number in the registry were absent or lower. But the conditional arguments can't evaluate w.x.y.z properly, as says the documentation. The documentation then suggests AppSearch, but AppSearch RegistrySearch can only check for existence, not version number comparison either. Apparently the FileSearch can, but the assembly file version numbers will not be incremented with each build.
And I've read that MergeModules have many problems - maybe these are them - but wixlibs don't seem to offer any solutions to these problems either.
So what is the right way to do merge module versioning??? I found a book that has a TOC entry called "merge module versioning" on Amazon but the book is out of print. :-P