cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
spaolobitech
Level 3

Disable a feature if IIS is not installed

Hello everyone,

I have a Basic MSI project with some features that require IIS to be installed. I'd like to disable the features if IIS is not installed...

I tried adding a condition to the features (like IIS_VERSION=''...) but cannot quite succeed...

Can someone please help me?

Thanx in advance
Paolo
Labels (1)
0 Kudos

(7) Replies
RobertDickau
Flexera Alumni

Is this a web project or do you have a virtual directory in your project? I believe IIS_VERSION will be empty, if not.

Otherwise, if you create an MSI log file, is IIS_VERSION defined?
0 Kudos
spaolobitech
Level 3

Hello Robert,

thanx for answering

I do have virtual directory (actually 3 vdirs) in my project and i have several components that get installed to the directories.

The project itself is a Basic MSI and not Web project, as I plan also to include in the same big project some regular windows apps and some services.

I was able to locate IIS_VERSION in system search (I guess IS did create it when I added the first vdir).

Also I was able to read the Msiproperty (IIS_VERSION) in a script I bound to a custom action (it actually returns a 2 char string with "#5", I guess that means major version of IIS is 5, if i run the same script on a IISless box I get empty string, which is fine).

What I really am struggling with is disabling my Web features if IIS is not installed... Tried adding a condition on the feature but to no avail, what I am missing?

Thanx
Paolo
0 Kudos
RobertDickau
Flexera Alumni

What does your feature condition look like?
0 Kudos
davidh
Level 6

Sounds like IIS_VERSION is being set properly, maybe use 'NOT' in your condition, like here?:
http://community.installshield.com/showthread.php?t=158303&highlight=IIS_VERSION+version+condition
0 Kudos
spaolobitech
Level 3

Hello and thanx for answering,

I was (almost) able to achieve what I wanted.

I set the property INSTALLLEVEL to 50 for the project and the installlevel for the web features to 100.

Added a condition to all three web features with Level 100 and condition ((IIS_VERSION="#5") OR (IIS_VERSION="#6") OR (IIS_VERSION="#7")) and this works if IIS is detected then the features are selected for installation, if iis is not detected they are not, fine.

What I didn't know is that if user selects custom installation he/she is still able to select the web features even if IIS is not there!!!

What I'd like to do is to disable (even in custom mode) the option to install the web features if IIS is not installed on the box... Is this possible???

Thanx in advance
Paolo

I also discovered that if I choose Complete install the web features are installed even if IIS is not on the box. So what are the conditions on features for? If I choose complete they are installed even if the conditions evaluate to false... If I choose custom they are shown as not installed (red X) but I still can install them... I must be missing something :confused:
0 Kudos
davidh
Level 6

Maybe check the Level column value. According to the help on INSTALLLEVEL, "If the value of the Level column in the Feature table is 0, that feature is not installed and not displayed in the UI."
0 Kudos
spaolobitech
Level 3

Thanx for answering and being patient 😄

I managed to make it all work adding a condition that sets INSTALLEVEL to 0 when ((IIS_VERSION<>"#5") AND (IIS_VERSION<>"#6") AND (IIS_VERSION<>"#7"). So the web features will be installed (if user selects complete) or available to be installed (if user selects custom) only if IIS is there...

Right now I'm battling with services not being uninstalled...

Ciao
Paolo
0 Kudos