DeleteComponent Method

InstallShield 2022 » Automation Interface

Project:This information applies to the following project types:

Basic MSI
DIM
InstallScript
InstallScript MSI
InstallScript Object
Merge Module

Call DeleteComponent to delete a component in the project. Similar to deleting a component in the Setup Design views, DeleteComponent both removes a component from its feature and permanently deletes it from the project.

Syntax

DeleteComponent (Component As ISWiComponent)

Parameters

DeleteComponent Method Parameters

Parameter

Description

Component

Specify the ISWiComponent object that the method will delete.

Example

You can use the following lines to delete all components that are associated with the feature FeatureName1:

Dim pProj As ISWiProject

Set pProj = CreateObject("IswiAutoAutomation Interface Version.ISWiProject")

pProj.OpenProject "C:\MySetups\Project1.ism"

 

Dim pFeat As ISWiFeature

Dim pComp As ISWiComponent

 

Set pFeat = pProj.ISWiFeatures.Item("FeatureName1")

 

For Each pComp In pFeat.ISWiComponents

    pProj.DeleteComponent pComp

Next

 

pProj.SaveProject

pProj.CloseProject

Applies To

ISWiProject