AddComponent Method

InstallShield 2022 » Automation Interface

Project:This information applies to the following project types:

Basic MSI
DIM
InstallScript
InstallScript MSI
InstallScript Object
Merge Module

The AddComponent method creates a component object with the specified name in the current project.

When the component is added, a GUID is automatically generated for it (see the GUID property for ISWiComponent). After you have added the component, you can set its other properties and associate it with a feature.

Syntax

AddComponent (ComponentKey As String) As ISWiComponent

Parameters

AddComponent Method Parameters

Parameter

Description

ComponentKey

The component key is the same as the name of the component that is displayed in the Setup Design views. This string must contain only alphanumeric characters, dots (.), or underscores (_), and it must begin with a letter or an underscore. ComponentKey must be unique among your project's component names.

Component names are case-sensitive.

Example

The following Visual Basic lines demonstrate this method:

    Dim pComponent As ISWiComponent

    Set pComponent = m_pProject.AddComponent ("New_Component")

Applies To

ISWiProject