Step 3: Registering COM Servers

InstallShield 2022 » InstallScript Project 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 self-registering file.

In this step you will create a component that installs and registers Tutorial.ocx and an HTML file that uses it.

A COM server is usually a DLL or .ocx file 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.

To install a self-registering file:

1. Go to the Files and Folders view.
2. At the top of the Files and Folders view, in the View Filter list, select the ProgramFiles feature.
3. In the Source computer’s folder pane, browse for Tutorial.ocx in your source directory.
4. Drag Tutorial.ocx from the Source computer’s folders pane and drop it into the Destination computer’s folders pane’s Application Target Folder. The component SelfRegFiles is created under Application Target Folder; this component contains Tutorial.ocx and has its Self-Register property set to Yes, as you can verify by right-clicking the component and selecting Properties.

Next, add the HTML file to a new component also associated with the ProgramFiles feature.

To add the HTML file to a new component associated with the ProgramFiles feature:

1. In the Destination computer’s folders pane of the Files and Folders view, right-click Application Target Folder and select New Component.
2. Rename the component OcxHTML.
3. Drag the file TutorialCtrl.html from the Source computer’s files view into the OcxHTML component.

After rebuilding your release (by pressing F7) and running the installation (by pressing CTRL+F5), you can verify that the file 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 next step of the tutorial demonstrates how to install files conditionally.