Adding Merge Modules to Your Setup
Merge modules are another method of packaging a component for redistribution. The beauty of merge modules is that they're independent installation components that contain all the necessary logic to successfully install, but they can't be installed on their own. They must be part of an MSI package. Like the setup project you created earlier, you can create a merge module project with resources, dependencies, launch conditions, and custom actions. Merge modules are very useful for pre-packaging components that must be shared across multiple resources on a computer, or just as a mechanism of breaking apart a large installation.There's a Merge Module project template that you can use to create your own merge modules, or you can add a merge module to your setup project if it already exists.To find out how to add a merge module, return to the InstallerTestSetup project and get to the File System Editor by right-clicking on the project name and selecting View, File System Editor from the contextual menu.Next, select Add, Merge Module from the Project main menu. You're now prompted with the Add Module dialog that Figure 4.27 displays.
Figure 4.27. The Add Modules dialog box.

In the C:\Program Files\Common Files\Merge Modules folder there are predefined merge modules for several components. Select the msmask32_X86_ENU.msm as shown in Figure 4.27. Notice that merge modules have an .msm extension. After the file is selected, it can be seen in your Solution Explorer.When you build the application, the MSMakedEdit control's merge module will be included with the MSI package, and it will install as part of your package.If the installation of the merge module fails, the complete installation fails because the merge module is part of the package. From your point of view, it's just another component to include in your deployment package.