![]()
|
InstallShield 2008 ยป Automation Interface
The AddFeature method creates a feature with the specified name. AddFeature is a member of ISWiProject. The new feature is added to the current project as a top-level feature, but when this method is a member of an ISWiFeature object, the new feature is added as a subfeature of the current feature.
The feature is created with the same default properties that new features have when you add them in the IDE.
The following Visual Basic lines demonstrate calling AddFeature to add a feature, a subfeature, and then associate an existing component with the subfeature:
Dim pProject As ISWiProject
Set pProject = New ISWiProject
pProject.OpenProject "C:\MySetups\SampleApp.ism"
Dim pFeat1, pFeat2 As ISWiFeature
Dim sFeat1Name, sFeat2Name As String
sFeat1Name = "ParentFeature"
sFeat2Name = "SubFeature"
' Add the feature ParentFeature, then SubFeature under ParentFeature
Set pFeat1 = pProject.AddFeature(sFeat1Name)
Set pFeat2 = pFeat1.AddFeature(sFeat2Name)
Dim pComp
Dim sCompName As String
' Add the existing component NewComponent1 to SubFeature
sCompName = "NewComponent1"
Set pComp = pProject.ISWiComponents.Item(sCompName)
pFeat2.AttachComponent pComp
pProject.SaveProject
pProject.CloseProject
After you have added the feature, you can set its other properties and associate components with it.
AddFeature (FeatureKey As String) As ISWiFeature
|
|
Copyright Information | Contact Macrovision |