Anthrax
Posts: 19
Joined: Tue Jul 31, 2007 1:51 pm

Feature Install only selectable, when a condition is true

Hi,

in my Installation package, i distribute a Web-Application, which need the IIS5.1 to be installed. My condition is, that the user can only
install this feature, when IIS is installed on the Target machine. Otherwise he should get a messagebox, that IIS is not installed an he should install it first.
In my first try, i have configured a Launch condition, which checks if the IIS is installed, but when the user don't want to install the Web application,
he don't need to install IIS. Can anybody help me to accomplish this?

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

Re: Feature Install only selectable, when a condition is true

Hi,

This can be done only by using a custom action because it is not supported directly by Windows Installer. Basically, this custom action will detect the installed IIS version and if the feature will be installed.

The IIS version can be detected by searching for the "inetsrv" file in the "system32" folder or by searching in the HKEY_LOCAL_MACHINE\Software\Microsoft\InetStp registry key. Also, the state of the feature can be determined by using the FeatureRequestState property (for example, if Session.FeatureRequestState("test")=3 then the feature "test" is marked for installation).

If the required IIS version is not present and the feature is marked for installation, the custom action can show a custom message to the user.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Anthrax
Posts: 19
Joined: Tue Jul 31, 2007 1:51 pm

Re: Feature Install only selectable, when a condition is true

Hi cosmin,

that worked. Thank you very much.

Return to “Common Problems”