cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
senthil_vpc
Level 4

How do i change Product Bean Active Property

Hi ,
At run time I want to detect if the user has selected to install a feature in run time during the installation . Base on the this selection , i want to set one of its dependant bean active property to false so that it not installed.

At design time, MyBean active property is true. i am trying to retrieve this active property in OnInstalling method of the root product.
the proplem is even though the user has not selected the feature(MyBean)
, it is returned with true.
here is what i am doing in OnInstalling method.
public void onInstallingMyRootProductbean(com.installshield.event.product.ProductInstallContext context)
{
String isUserDefinedAppSelected=context.resolveString("$P(bpfUserDefinedConfigurationFeatureBean.active)");
}
isUserDefinedAppSelected is returned with "true" even though the user has not selected this feature to install.

any help?

Thanks
Senthil
Labels (1)
0 Kudos
(2) Replies
senthil_vpc
Level 4

OnInstalling method itself let us check the active property. I was wrong previously.

This is how we can change the product bean active property at runt time.

ProductBean ourBean=context.getProduct().getProductTree().getBean("beanId");
ourBean.setActive(true);

Thanks
Senthil
0 Kudos
enanrum
Level 9

Just to give another way of many I'm sure!

ProductService service = (ProductService) arg0.getService(ProductService.NAME);
service.setProductBeanProperty(ProductService.DEFAULT_PRODUCT_SOURCE, BeanID,PropertyName,value);
service.setProductBeanProperty(ProductService.DEFAULT_PRODUCT_SOURCE, "beanid","active","true");


Regards
0 Kudos