views:

340

answers:

3

I've got a couple of solutions that represent a framework of code that I've built up at work. One solution called 'Framework' and another called 'Extensions'.

The reason I split them is that the 'Extensions' solution contain projects that consist of extension methods, and the projects are organized so that the resulting assemblies mirror the .NET assemblies.

I created a merge module project for 'Extensions', and an installer that uses it. It's all fine and dandy - but now I want to create an installer for 'Framework' that also uses that same merge module. Consequently, I'd like to modify the 'Extensions' installer to copy the 'Extensions' merge module file to C:\Program Files\Common Files\Merge Modules so that the 'Framework' installer will have a well-known path by which to reference the merge module for 'Extensions', rather than referencing whatever obscure path my VS solution lives in (the reason being that the Framework will at times be built on different machines on which paths to VS projects may vary).

The MSDN documentation addresses this only briefly, and merely says that merge modules cannot be installed to the file system, but can only be "consumed".

Fail.

Does anyone know a way around this? Custom actions? How does the Visual Studio installer install it's merge modules?

A: 

When you create the MergeModule installer as part of the file system editor there is a folder called "Module Retargetable Folder" (this is the default name and can be changed, also additional ones can be added).

Once the .msm has been built if you go to the main setup project and add the merge module to it you can select the .msm in the solution explorer and looking at the properties window there should be an entry called "MergeModuleProperties", expand this and you should see all the retargetable folders listed and you can then point them to the correct place.

PlausiblyDamp
No, I think you misunderstand what I'm asking - I want the main installer to place the .msm file onto the file system in addition to extracting the retargetable filesystem.
Ben Collins
In that case could you not just add the msm as just another file as well and use the normal file system part of the setup package to deploy to a know location?
PlausiblyDamp
No; if you drag the .msm file to the filesystem view, it just uses it as a normal merge module (i.e., nothing appears in the filesystem view).I've now scrapped the whole idea and merged my two solutions into one, which has obviated the need for a merge module in the first place.
Ben Collins
A: 

Short answer is: there is no way to do this, short of writing your own installation framework.

Ben Collins
A: 

Late to the party, but

I did this once by renaming the merge module (changed the file extension), installing it to the file system as a normal file, then renaming the installed file.

DaveE