How to add new components to a merge module by using Visual Studio .NET

Article translations Article translations
Article ID: 827025 - View products that this article applies to.
Expand all | Collapse all

On This Page

SUMMARY

This step-by-step article describes how to add new components to a merge module by using Microsoft Visual Studio .NET.

A merge module is a standard feature of Microsoft Windows Installer that packages components together with any related files, resources, registry entries, and setup logic. You can use merge modules to install components that multiple applications share. You cannot install merge modules directly. You must merge them into deployment projects.

This article describes how to create a merge module project in Visual Studio .NET, how to consume the merge module in a Setup project, and how to add new components to the merge module by using Visual Studio .NET.

Requirements

The following list outlines the recommended hardware, software, network infrastructure, and service packs that you need:
  • Microsoft Windows 2000, Windows XP, or Windows Server 2003
  • Microsoft Visual Studio .NET
This article assumes that you are familiar with the following topics:
  • Visual Studio .NET Setup projects

Create a merge module by using Visual Studio .NET

To create a merge module project by using Visual Studio .NET, follow these steps:
  1. Start Visual Studio .NET.
  2. On the File menu, point to New, and then click Project.
  3. Under Project Types, click Setup and Deployment Projects.
  4. Under Templates, click Merge Module Project.
  5. In the Name box, type MyMergeModule, and then click OK.
  6. In Solution Explorer, right-click MyMergeModule, point to Add, and then click File.
  7. In the Add Files dialog box, locate the Msbind.dll file. This file is in the Program Files\Microsoft Visual Studio .NET\Common7\Controls folder.
  8. Click msbind.dll, and then click Open.
  9. In Solution Explorer, right-click MyMergeModule, and then click Build.

Create a Setup project that consumes the merge module

To create a setup project in Visual Studio .NET that consumes the MyMergeModule merge module, follow these steps:
  1. On the File menu, point to New, and then click Project.
  2. Under Project Types, click Setup and Deployment Projects.
  3. Under Templates, click Setup Project.
  4. In the Name box, type MyApp, and then click OK.
  5. In Solution Explorer, right-click MyApp, point to Add, and then click Merge Module.
  6. In the Add Modules dialog box, locate the MyMergeModule.msm file. This file is in the MyMergeModule\Debug folder.
  7. Click MyMergeModule.msm, and then click Open.
  8. In Solution Explorer, right-click MyMergeModule.msm, and then click Properties.
  9. In the Properties window, expand MergeModuleProperties.
  10. Click the Module Retargetable Folder property, and then click Browse in the drop-down list.
  11. In the Select Folder dialog box, click Application Folder, and then click OK.
  12. Click the Files property, and then click the ellipsis button (...). The Files dialog box appears.

    Notice that the Msbind.dll file appears in the Files dialog box.
  13. Click OK.
  14. On the File menu, click Save All.

Add new components to the merge module

To add new components to the MyMergeModule merge module, follow these steps:
  1. On the File menu, point to Open, and then click Project.
  2. In the Open Project dialog box, locate the MyMergeModule.sln file. This file is in the MyMergeModule folder.
  3. Click MyMergeModule.sln, and then click Open.
  4. In Solution Explorer, right-click MyMergeModule, point to Add, and then click File.
  5. In the Add Files dialog box, locate the Dbadapt.dll file. This file is in the Program Files\Microsoft Visual Studio .NET\Common7\Controls folder.
  6. Click dbadapt.dll, and then click Open.
  7. In Solution Explorer, right-click MyMergeModule, and then click Build.

Verify that the new components have been added to the merge module

To verify that the new components have been added to the merge module, follow these steps:
  1. On the File menu, point to Open, and then click Project.
  2. In the Open Project dialog box, locate the MyApp.sln file. This file is in the MyApp folder.
  3. Click MyApp.sln, and then click Open.
  4. In Solution Explorer, right-click MyMergeModule.msm, and then click Properties.
  5. In the Properties window, click the Files property, and then click the ellipsis button.

    Notice that the Msbind.dll file and the Dbadapt.dll file appear in the Files dialog box.

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
307353 HOW TO: Create a Setup Package by Using Visual Studio. NET
For more information, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/0h4bhcz3(vs.71).aspx

Properties

Article ID: 827025 - Last Review: April 16, 2007 - Revision: 1.5
APPLIES TO
  • Microsoft Visual Studio .NET 2003 Enterprise Architect
  • Microsoft Visual Studio .NET 2003 Enterprise Developer
  • Microsoft Visual Studio .NET 2003 Academic Edition
  • Microsoft Visual Studio .NET 2002 Professional Edition
  • Microsoft Visual Studio .NET 2002 Enterprise Architect
  • Microsoft Visual Studio .NET 2002 Enterprise Developer
  • Microsoft Visual Studio .NET 2002 Academic Edition
  • Microsoft Windows Installer 2.0
Keywords: 
kbhowtomaster kbhowto kbupgrade kbsetup kbdeployment KB827025

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com