Step 3: Registering COM Servers

InstallShield 2018 » Basic MSI Tutorial

For many files, the installation’s only requirement is to copy the files from the source media to the target system. For others, the installer also needs to register the files with the target system. One category of file that needs extra handling is a COM server, commonly known as a self-registering file or ActiveX control. A COM server is usually a DLL or OCX that requires extra information to be written to the target system’s registry before applications and Web pages that use the self-registering file can find it.

Creating a COM Server Component

To install and register these and other types of files, you can use the Component Wizard. The Component Wizard creates components that copy the files, and perform any additional registration steps. In this step you will create a component that installs and registers Tutorial.ocx and an HTML file that uses it.

To create a COM server component:

1. Open the Files and Folders view. The Files and Folders view is located in the Application Data section of the View List.
2. At the top of the Files and Folders view, in the View Filter list, select the Tutorial_Files feature.
3. In the Destination computer’s folders pane, right-click the [INSTALLDIR] folder and select Launch Component Wizard.
4. In the Welcome panel of the Component Wizard, select the Let me select a type and define the component myself option and click Next.
5. In the Component Type panel, select the COM Server icon, type Tutorial.ocx in the Component Name field, and click Next.
6. In the COM Server—Destination panel, verify that the destination is set to [INSTALLDIR].
7. In the COM Server File panel, click the browse button next to the COM Server File field and browse for Tutorial.ocx in your tutorial files source directory. Click Next.
8. After the Component Wizard has extracted the COM information, review the COM information and click Finish to create the component.

The next step is adding the HTML file to the component you just created.

To add the HTML file to the component:

1. In the Destination computer’s folders pane of the Files and Folders view, select the new Tutorial.ocx component.
2. Drag the file TutorialCtrl.html from the Source computer’s files pane to the Destination computer’s files pane.
3. Verify that Tutorial.ocx is marked as the key file of its component.

Note • See Registering COM Servers for other options for registering self-registering files, including extracting COM information each time that you rebuild the release—for COM servers with interfaces that change between builds—or calling the file’s self-registration functions.

Verifying that the COM Server Was Registered

After rebuilding your release (by pressing F7) and running the installation (by pressing CTRL+F5), you can verify that the COM server was registered properly:

1. Launch Tutorial App using its shortcut in the Programs menu, or by double-clicking its icon.
2. Choose COM Server Test from the Tutorial menu.
3. If the COM server was registered correctly, the HTML page displays a “success” message.

The Component Wizard can also create components that install and configure fonts and Windows NT services.

The next step of the tutorial demonstrates how to install files conditionally.

See Also