Export (0) Print
Expand All

Walkthrough: Creating and Consuming a Merge Module

This walkthrough demonstrates how to package a component in a merge module and to consume that merge module in a setup project.

Note   Merge Module Projects are not available in the Standard Edition of Visual Basic .NET. For more information, see Visual Basic Standard Edition Features.

To create a component

  1. On the File menu, point to New, and then choose Project.
  2. In the New Project dialog box, select Visual C# Projects in the Project Type pane, and then choose Class Library in the Templates pane. In the Name box, type MyComponent.
  3. Click OK to close the dialog box.
  4. On the Build menu, choose Build MyComponent to build the class library.

To create a merge module project

  1. On the File menu, point to Add Project, and then choose New Project.
  2. In the Add New Project dialog box, select Setup and Deployment Projects in the Project Type pane, and then choose Merge Module Project in the Templates pane. In the Name box, type Sample.
  3. Click OK to close the dialog box.
  4. In the File System Editor, select the Module Retargetable Folder. On the Action menu, point to Add, and choose Project Output.
  5. In the Add Project Output Group dialog box, select the Primary Output of the MyComponent project. Click OK to close the dialog box.
  6. On the Build menu, choose Build Sample to build the merge module.

To add a Setup project that consumes the merge module

  1. On the File menu, choose Add Project, New Project.
  2. In the Add Project dialog box, select Setup and Deployment Projects in the Project Type pane, and then choose Setup Project in the Templates pane. In the Name box, type Merge Module Installer.
  3. Click OK to close the dialog box.
  4. In the File System Editor, select the Application Folder. On the Action menu, point to Add, and choose Project Output.
  5. In the Add Project Output Group dialog box, select the Sample project, then select Merge Module.
  6. Click OK to close the dialog box.

    Note that the merge module is not added to the folder. It is added to the Merge Module Installer project in Solution Explorer. This is because merge modules cannot be installed directly; they must be merged into an installer.

  7. Select the merge module (Merge Module from Sample (Active)) in Solution Explorer. In the Properties window, select the KeyOutput property and expand the node to display the (Merge Module Properties) node, then expand that node and select the Module Retargetable Folder property.
    Note   The properties beneath the KeyOutput property are dynamic properties that do not appear until the merge module has been built.
  8. Select the drop-down list for the Module Retargetable Folder property and click Browse... to display the Select Folder dialog box.
  9. In the Select Folder dialog box, choose Application Folder. Click OK to close the dialog box.
  10. On the Build menu, choose Build Merge Module Installer.

To install on your development computer

  • Select the Merge Module Installer project in Solution Explorer. On the Project menu, choose Install.

    This will run the installer and install Merge Module Installer on your development computer. The installer will install the component contained in the merge module to the application directory.

    Note   You must have install permissions on the computer in order to run the installer.

To deploy to another computer

  1. In Windows Explorer, navigate to your project directory and find the built installer. The default path will be \documents and settings\yourloginname\Merge Module Installer\project configuration\Merge Module Installer.msi. The default project configuration is Debug.
  2. Copy the Merge Module Installer.msi file and all other files and subdirectories in the directory to another computer.
    Note   To install on a computer that is not on a network, copy the files to traditional media such as CD-ROM.

    On the target computer, double-click the Setup.exe file to run the installer.

    Note   You must have install permissions on the computer in order to run the installer.

To uninstall the application

  1. In the Windows Control Panel, double-click Add/Remove Programs.
  2. In the Add/Remove Programs dialog box, select Merge Module Installer and click Remove.
  3. Click OK to close the dialog box.
    Tip   To uninstall from your development computer, on the Project menu, choose Uninstall.

See Also

Introduction to Merge Modules | Installer vs. Merge Module Recommendations | Retargetable Merge Modules

Show:
© 2014 Microsoft