brianh
Posts: 18
Joined: Mon Apr 11, 2011 9:14 am

Problem using conditions on feature based pre-requisite

Hi,

We are trying to set up a "Feature-based pre-requisite" so that it will only be installed if either one of two other features are to be installed.
The feature is actually the Visual Basic 6.0 runtime.
We have tried setting up the "Install based on condition" condition field of the feature to:

(&Feature1 = INSTALLSTATE_LOCAL) OR (&Feature2 = INSTALLSTATE_LOCAL)

We have also tried setting this condition on the automatically generated component within the pre-requisite feature.
We have tried using numbers instead of the constant and using both "3" and "5" as indicated in one of the help pages.

The pre-requisite feature is at the same level in the Organization as both of the features.

Nothing works.

If we set conditions on the feature then it never installs the pre-requisite, if we use the component then it always installs it.

We are using Advanced Installer Professional 8.3

Thanks,

Brian Hutchison
SIAS Limited
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problem using conditions on feature based pre-requisite

Hi Brian,

To achieve this, from the Dialogs page you can try to set the following published events on the VerifyReadyDlg Install button:
http://www.advancedinstaller.com/user-g ... section120
AddLocal.jpg
AddLocal.jpg (21.71 KiB) Viewed 6636 times
http://www.advancedinstaller.com/user-g ... section135
Remove.jpg
Remove.jpg (22.19 KiB) Viewed 6636 times
To cover a silent install as well you would also have to define a default state for your features from the Organization page.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
brianh
Posts: 18
Joined: Mon Apr 11, 2011 9:14 am

Re: Problem using conditions on feature based pre-requisite

Thanks, we will give that a try.
brianh
Posts: 18
Joined: Mon Apr 11, 2011 9:14 am

Re: Problem using conditions on feature based pre-requisite

Unfortunately we do not seem to have this feature.
As stated in my original post, we are using the "Professional" version and this appears to only be available in the "Enterprise" edition.

Any other ideas?

Thanks,

Brian
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problem using conditions on feature based pre-requisite

Hi Brian,

I'm sorry, I missed that. The above is indeed Enterprise edition functionality.

There's not much you can do regarding this with the Professional edition. You could try to add two identical prerequisites and include each of their features as a subfeature to Feature1 and Feature2, but it's a long shot. This and enabling the "Use parent feature installation settings" installation setting should cover installing the prerequisite when either of your features get selected in the CustomizeDlg.
However the duplicate case will remain when both are selected to be installed. You could combine this with the prerequisite's install conditions search criteria to cover all loose ends.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
brianh
Posts: 18
Joined: Mon Apr 11, 2011 9:14 am

Re: Problem using conditions on feature based pre-requisite

Thanks,

That is basically what we ended up doing.
We didn't go to the bother of finding a way to block the "double-install" issue since it was such a small, and silent, install.

A small change in AI would resolve this - it would seem that pre-requisite install conditions are tested all at once before the install begins.
This means that when it reaches the second (duplicate) install it still thinks it needs to install it.
If the install conditions were tested immediately prior to the actual install then it would find it no longer needed to install it.

Brian
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problem using conditions on feature based pre-requisite

Hi Brian,
If the install conditions were tested immediately prior to the actual install then it would find it no longer needed to install it.
Unfortunately, this is how Windows Installer handles install conditions. However I will mention this request to my colleagues from the development team and if possible we will consider it for a future version.

As a workaround, you could try to create the "AddLocal" and "Remove" events functionality( linked in my first reply ) using your own custom actions. You can schedule them for example after the ProgressDlg standard action and set them with the same execution conditions from the screen shots.

Here are the related Windows APIs to get you started with the custom actions:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”