cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ashahidi
Level 4

IIS_VERSION Check?

I've looked in the InstallShield help which says that the IIS_VERSION property contains the IIS version of the machine you are using.

I'm trying to install to both Windows XP and 2003 systems so I need something to check which version of IIS is running.

Here's what I have currently where I'm checking the value of IIS_VERSION and outputting it to a text file. This currently returns back nothing for the IIS_VERSION property. Does anybody have an idea why I'm not getting a value back?



Set iisinfo = GetObject("IIS://localhost/W3SVC/Info")

Dim x, versionNumber, a, outputText

x = Session.Property("IIS_VERSION")
a = Len(x)
versionNumber = Right(x, a)

Dim objFSO, objFSOText, objFile
Dim strDirectory, strFile
strFile = "C:\Output.txt"

outputText = "x: " & x & " a: " & a & " versionNumber: " & versionNumber

' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.CreateTextFile(strFile)

objFile.WriteLine(outputText)
objFile.Close
Labels (1)
0 Kudos
(6) Replies
RobertDickau
Flexera Alumni

Does your project contain a virtual directory, or is it a Web project? Either of those has to be true for the system search that populates the IIS_VERSION value to be added to the project...
0 Kudos
ashahidi
Level 4

Yes, it is a web project and I'm also dealing with virtual directories inside of this project.
0 Kudos
RobertDickau
Flexera Alumni

If you look in the System Search view, are the searches that populate IISROOTFOLDER and IIS_VERSION present? Is your code being called from an action that runs after the AppSearch action?
0 Kudos
ashahidi
Level 4

I looked in the System Search view and there are searches there that populates both values. I looked in my registry and there is indeed a value of 5 (I'm running on XP currently).

Secondly, my code is being called after the AppSearch gets executed.
0 Kudos
RobertDickau
Flexera Alumni

As a sanity check, if you put

MsgBox "x = " & x

after your Session.Property line, does a value show up? (For example, I'm not sure what your code that calls the Right function is doing, so looking at the original value might be useful.)
0 Kudos
ashahidi
Level 4

Hmm, I put the IIS_VERSION property back as the value for x and ran it again and it seems to be working fine now. Not sure what I was missing in the first place, but thanks!
0 Kudos