You use the Associations editor to set up Windows registration of COM objects installed with your product in Microsoft® Visual Studio® Installer. In order to install and register COM objects in a way that takes advantage of the rollback and advertising features of the Microsoft® Windows® installer, you must associate each installed COM object with a type library. The Associations editor in Visual Studio Installer provides the means to manage type libraries in your installer project and associate them with COM objects.
This topic explains how to:
You can add only existing type libraries to an installer project; you can not create type libraries in the installer project. Any existing type library will already have been associated with a COM object outside of your installer project, but you must reestablish that association within the installer project.
To add an existing type library to an installer project, you must know the LibID (the GUID uniquely identifying the type library). Several strategies are available for determining the LibID of a type library.
To find the LibID for an object from this source | Do this |
Microsoft® Visual Basic® or a third-party control you do not have source code for | Use the Visual Studio OLE/COM Object Viewer. For more information, search for "OLE/COM Object Viewer" in the MSDN™ Library (Entire Collection). Note When you create a sharable COM object in Visual Basic, you should use the Binary Compatibility option to preserve its CLSID between versions. For more information, search for "binary compatibility" in MSDN Library, Visual Basic Documentation. |
Microsoft® Visual C++® | Use the Visual C++ Object Viewer, or examine the appropriate header (.h) or Interface Definition Language (.idl) file for COM object information, including the LibID of an associated type library. For more information about the Object Viewer, search for "OLE/COM Object Viewer" in the MSDN Library (Entire Collection). |
The Associations editor is displayed.
A new type library is added to your project with a default LibID and shown in the Type Libraries node in the Associations editor.
Important You must change the default LibID so it matches the original LibID. For information about looking up the LibID for COM objects, see Before adding type libraries.
Before establishing type library associations
To facilitate correct COM object installation and registration on the target machine, you can associate type libraries with COM objects in your installer project. Before you can make this association, both the COM object and the type library must already be part of the installer project. For more information about adding these items to an installer project, see:
To associate type libraries with COM objects
For more information about the type library and COM object component property, see Type Library Properties and COM Object Properties.
The Type Libraries node shows the type library has been deleted from the installer project.