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



The information in this article applies to:

  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Academic Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition
  • Microsoft Windows Installer

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.

back to the top

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
back to the top

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.
back to the top

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.
back to the top

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.
back to the top

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.
back to the top

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:
back to the top

Modification Type:MinorLast Reviewed:5/23/2005
Keywords:kbHOWTOmaster kbhowto kbUpgrade kbsetup kbDeployment KB827025 kbAudDeveloper