Adding and Deleting Document Types and Associated File Extensions

See Also

You can add document types that work with your installed product in the Associations editor of Microsoft® Visual Studio® Installer. When you add a new document type to the project, Visual Studio Installer simultaneously adds one associated file extension. You may add multiple file extensions to each document type.

By adding a document type and associated file extensions, you establish that files with the associated extensions are files of the specified document type. For example, if you add the document type Word.Document and associate it with the file extension .doc, you establish that target machine .doc files are of the Word.Document type.

In the Associations editor, you can:

After associating document types and file extensions, you can associate verbs with the file extensions. Verbs establish the kinds of actions that can be performed on files. For more information about associating file extensions and verbs, see Adding and Deleting Verbs.

To add a document type and an associated file extension

  1. In the Project Explorer window, expand the Target Machine node under your installer project.

  2. Double-click Associations.

    The Associations editor is displayed.

  3. Right-click anywhere in the Associations editor.

  4. Select Add Document Type from the context menu.

    A new document type is added to your project, and its label, New Document Type, is shown in the Associations on Target Machine hierarchy. A new file extension labeled New Extension (or New Extension1, 2, 3, and so on) is also shown in the Associations on Target Machine hierarchy, associated with the new document type.

    You can change the default New Extension name right away, if desired. For more information, see To rename a document type or file extension.

    You can also add and associate additional extensions with this document type. For more information, see To associate another file extension with a document type.

To rename a document type or file extension

  1. Display the Associations editor.

  2. If necessary, expand the Associations on Target Machine hierarchy to show the document type or file extension you want to rename.

  3. Right-click the document type or file extension you want to rename.

  4. Select Rename from the context menu.

  5. Enter the new name for the document type or file extension.

    Note   You cannot include two extensions with the same name in an installer project, even if those extensions are associated with different document types. Each extension in an installer project must have a unique name.

To associate another file extension with a document type

  1. Display the Associations editor.

  2. If necessary, expand the Associations on Target Machine hierarchy to show the document type you want to associate with another file extension.

  3. Right-click the document type you want to associate with another file extension.

  4. Select Add File Extension from the context menu.

    A new file extension is associated with the document type and shown in the Associations on Target Machine hierarchy with the label New Extension (or New Extension1, 2, 3, and so on). You can change the default New Extension name right away, if desired.

To delete a document type or file extension

  1. Display the Associations editor.

  2. If necessary, expand the Associations on Target Machine hierarchy to show the document type or file extension you want to delete.

  3. In the Associations on Target Machine hierarchy, right-click the document type or file extension you want to delete.

  4. Select Delete from the context menu.

    The Associations on Target Machine hierarchy shows the document type or file extension has been deleted from the installer project. If you delete a document type, all file extensions associated with it are also deleted.