RemoveFeature Method
InstallShield 2020 » Automation Interface
Project:This information applies to the following project types:
| • | Basic MSI | 
| • | DIM | 
| • | InstallScript | 
| • | InstallScript MSI | 
| • | InstallScript Object | 
| • | Merge Module | 
The RemoveFeature method permanently deletes a feature from the current project.
Syntax
RemoveFeature (Feature As ISWiFeature) As Long
Parameters
| Parameter | Description | 
| Feature | The item in ISWiFeatures that you want to remove. | 
Example
The following code fragment opens a project, deletes the feature named NewFeature1, and then saves and closes the project:
Dim pProj As ISWiProject
Dim pFeat As ISWiFeature
Set pProj = New ISWiProject
pProj.OpenProject "C:\Test\SampleProject.ism"
Set pFeat = pProj.ISWiFeatures.Item("NewFeature1")
pProj.RemoveFeature pFeat
pProj.SaveProject
pProj.CloseProject
When RemoveFeature is a member of ISWiFeature, it cannot be used to delete the current feature. However, you can call it to delete a subfeature, such as the first subfeature under NewFeature1 in the following example:
Set pFeat = pProj.ISWiFeatures.Item("NewFeature1")
pProj.RemoveFeature pFeat.Features(1)
Applies To
| • | ISWiProject | 
| • | ISWiFeature |