Conditional install feature - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

chen
Posts: 18
Joined: Mon Nov 26, 2007 6:02 pm

Conditional install feature

Hi,

I am trying to install a add-on module for IE and FireFox. I grouped the files and components into two feature group, IE and FireFox respectively. But I ran into a problem. I wrote a VBS script to check the path of FireFox and store the path into a property FIREFOXPATH, by default its value is "" (empty). And I ignored the return value of script because it will fail if FireFox is not installed.

Here are the questions:
1. Is there a way to add the installation condition to the entire feature group? I tried to create custom INSTALLLEVEL based on the condition of "NOT FIREFOXPATH" and set the INSTALLLEVEL to 8. The installer package just disable the whole feature completely.

2. Then I tried to set the condition of each components within FireFox feature group to install if "NOT FIREFOX" is met. It doesn't work either. The feature group is enabled in the Setup Type Dialog. But the installer won't install FireFox components whether FireFox is installed or not. Did I set the condition wrong?

3. Is there a similar condition that I can set for IE feature group? We require at IE 6.

Thanks,

PC
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional install feature

Hi,

Please note that the Feature conditions (stored in the "Condition" table inside the MSI database) are processed during the "CostFinalize" action. After this stage, any changes in the conditional expression evaluation do not affect the InstallLevel of the Features. Therefore, a solution would be to make sure that your custom action runs before the "CostFinalize" standard action. This way the property set by the custom action will be evaluated and it should change the feature action (if it will be installed or not).

Another solution would be to use a different custom action which sets the feature action of your feature based on a custom property. You can find a sample custom action for this in the Show a custom feature selection dialog how-to.
Is there a similar condition that I can set for IE feature group?
In order to detect Internet Explorer you can use the same approach you used for FireFox (a custom action which sets a property).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chen
Posts: 18
Joined: Mon Nov 26, 2007 6:02 pm

Re: Conditional install feature

Thanks for replying so quick.
a solution would be to make sure that your custom action runs before the "CostFinalize" standard action
I put VBS script in InstallExecuteSequence|Begin and doesn't seem to have any effect. Any more thoughts?

Also, I noticed that FireFox feature was set to "Entire feature will be unavailable" in Custom Setup Dialog after I made the change.

I set the installation behavior of FireFox feature to "install by default" and the condition of each components within FireFox feature to "NOT FIREFOXPATH". Is this correct?

Thanks,

PC
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Conditional install feature

Hi,
I put VBS script in InstallExecuteSequence|Begin and doesn't seem to have any effect. Any more thoughts?
Also, I noticed that FireFox feature was set to "Entire feature will be unavailable" in Custom Setup Dialog after I made the change.
Please note that in order to see the change in the UI, the custom property must also be set during the UI sequence. Please follow these steps:
- go to the Custom Actions page
- show the "InstallUISequence" -> "Begin" standard action
- while the SHIFT key is pressed drag your custom action over "InstallUISequence" -> "Begin"
- set the "Execute only once if present in both sequence tables" option

This way, the custom action will be executed during the UISequence if there is an UI, or during the ExecuteSequence for a silent installation. If the custom action was not shared between the two sequences, the effect would be noticed only in the InstallExecuteSequence (the conditional feature will not be installed).
I set the installation behavior of FireFox feature to "install by default" and the condition of each components within FireFox feature to "NOT FIREFOXPATH". Is this correct?
Yes, this is correct. However, it may confuse the user if the installation contains the "SetupTypeDlg" dialog (for example he selects the feature to be installed and its components are not installed).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”