Install: Simple way to create merge module and install Shared Components

http://msdn.microsoft.com/en-us/library/aw2dz878(v=vs.80).aspx

Walkthrough: Installing Shared Components Using Merge Modules

Merge modules (.msm) are used to install components that are shared by multiple applications—for example, components (such as DLLs, controls, resources) that developers use in applications. In contrast, Windows installers (.msi) are used to install applications and files (such as executable files, documents, HTML pages), and are typically used by the end user of the application.

By using merge modules, you can help ensure that shared components are packaged and delivered for consistent deployment. For more information on merge modules, see Installer vs. Merge Module Recommendations.

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

Note
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

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, 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 then 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, point to Add, then click New Project.

2. In the Add New 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 then 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 (Merge Module from Sample (Active)) is not added to the folder. Instead, 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 in Solution Explorer. In the Properties window, expand the KeyOutput node, then expand the (Merge Module Properties) 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. Click the drop-down list for the Module Retargetable Folder property and select (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 SettingsyourloginnameMy DocumentsVisual Studio 2005ProjectsSolution Folder NameMy Notepad Installerproject configurationMy Notepad Installer.msi. The default project configuration is Debug or Release.

2. Copy Merge Module Installer.msi, Setup.exe, 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.

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

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

To uninstall the application

1. In Windows Control Panel, double-click Add or 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 of Visual Studio, choose Uninstall.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s