Optional Prerequisite - 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!

ramit
Posts: 90
Joined: Thu Dec 18, 2008 11:51 am

Optional Prerequisite

Hi,

I have 4 Features to install in my Installer.
User can install each Feature in separate machine. For example.

Feature1
Feature2
Feature3
Feature4

Feature4 requires IIS and rest does not requires IIS.
I set Prerequisite for IIS. Now if user do not want to install the Feature4, still installer is asking for IIS [that is should not be].
Please advice me how can I handle this problem.

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

Re: Optional Prerequisite

Hi Amit,

Unfortunately the IIS launch condition cannot depend on a feature. However, you can try this approach:
- in the Search page create a search which determines if IIS is installed or not (for example you can search for the "inetinfo.exe" and "w3wp.exe" files in the "[SystemFolder]inetsrv" folder)
- rename the search to something meaningful, for example IIS_SEARCH
- create a .VBS file which contains this code:

Code: Select all

Function Exit()
  MsgBox("Feature4 requires IIS to be installed. The installation will stop")
  Exit = 1602
End Function
- add the VBS file as an Attached custom action under "InstallExecuteSequence" -> "CostFinalize" as deferred
- in the Custom Action Properties page set the "Function Name" field to "Exit" (the name of the function)
- set the "Expression" field in the "Execution Condition"field to:

Code: Select all

(NOT IIS_SEARCH) AND (&Feature4 = 3)
The custom action will show a message box with the specified text and it will return the value 1602. This value is seen by Windows Installer as an user exit, so the installation will be canceled. The condition of the custom action is true if the property of the search is empty (the search didn't find anything) and Feature4 is marked for installation. Therefore, the custom action runs if IIS is not installed and Feature4 was selected for installation.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ramit
Posts: 90
Joined: Thu Dec 18, 2008 11:51 am

Re: Optional Prerequisite

Thanks its wokring.......

Return to “Common Problems”