validation check based on feature selection - best practice? - 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!

skipau
Posts: 31
Joined: Mon Feb 22, 2010 5:12 am

validation check based on feature selection - best practice?

hi there...

I would like to be able to do a check for registry existence when a particular feature is selected.

Currently I have everything in 1 feature and as part of that I have a custom action under InstallExecuteSequence -> InstallValidate which calls vbscript that checks the existence of the entry and results in an Error Message and termination of the install if it is not located.

The problem I have now is that I would like to separate the MSI into features and apply the check of the registry to only 1 of the features - so that is - if that particular feature is selected then I will run the check.

My initial thought was to leave the validation custom action script and just add a check using the FeatureRequestState - like following

if Session.FeatureRequestState("Feature4") = msiInstallStateLocal Then ....
'check registry here etc

I wondered though - is this is the best way - or is there another way to break down the custom actions for different Features?

btw I have Enterprise licence of the software.

Thanks

Skip.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: validation check based on feature selection - best practice?

Hi,

I'm afraid that this is not possible using a normal feature selection dialog (i.e. a tree). You cannot run a script that will
make the desired check when the feature is selected.

The solution is the following:
  • you will replace the feature selection dialog with a custom one, as in the following article
  • create on this dialog a checkbox for each of your features
  • select the checkbox corespondent to the feature for which you wish to make the search
  • now go to Control Conditions tab and set its state (Disabled/Enabled) based on search result
  • the search result will be placed in the Condition field and it represents the name of the search that you will make in the Search page
Please let me know if you have nay questions.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
skipau
Posts: 31
Joined: Mon Feb 22, 2010 5:12 am

Re: validation check based on feature selection - best practice?

Thank you very much for your detailed reply. I will give it a go and let you know if I hit any problems!

Cheers

Skip

Return to “Common Problems”