Any tricks for detecting IE version?
I'm building a package that needs to launch specific .exe's via custom action depending on what IE version is installed. (They can't be captured) Does anyone know of any tricks to reliably detect IE Version and SP level?
It seems that that IE is too intimate with the OS to have the usual Product & Upgrade code, can't seem to go that route. I know of HKLM\Software\Microsoft\Internet Exploer\Version and Build, but that drills down to the build level (the fourth group of # in the version) which changes depending on what security patches have been applied.
The only course of action I can think of is to add VB code to read the version and strip it to [##.##.####], get that in a Property and go from there. I really hope there is a less complex, and probably more reliable way.
It seems that that IE is too intimate with the OS to have the usual Product & Upgrade code, can't seem to go that route. I know of HKLM\Software\Microsoft\Internet Exploer\Version and Build, but that drills down to the build level (the fourth group of # in the version) which changes depending on what security patches have been applied.
The only course of action I can think of is to add VB code to read the version and strip it to [##.##.####], get that in a Property and go from there. I really hope there is a less complex, and probably more reliable way.
0 Comments
[ + ] Show comments
Answers (16)
Please log in to answer
Posted by:
VikingLoki
20 years ago
Plangton, I found your solution won't work.
The IF condition above will only resolve to true if you are running an UNPATCHED installation of IE6-WinXP. If you've added a patch, the version will be somewhere 6.0.2800.1106 (base IE6SP1) and 6.00.3663.0000 (IE6 for Windows Server 2003 RC1 Beta)
The same holds true for other versions. Patches will raise the version level to somewhere above the Base version number and below the base version number of the next release up.
So, to find the correct version of IE you must search for a RANGE of version numbers. This is best done using the AppSearch Table of the MSI, which accepts ranges. Wise simplifies the process with the Installation Expert - AppSearch section.
For a list of all version numbers of IE, refer to Microsoft Knowledgebase article Q164539 "How to Determine Which Version of IE is Installed".
I also found a few caveats. Although the Windows Installer docs say that the AppSearch range is inclusive (i.e. >=) it doesn't seem to be (i.e. just >). Also, the file that you should really be checking is Shdocvw.dll in System32. That's IE's primary dll and is what MS indicates as the true indicator of what IE version you're running.
If IE6SP1 then run the relevant patch
If IEVersion = "6.0.2800.1106" then
X = Sh.Run ("IE6.0-KB823353-WindowsXP-x86-ENU.exe /Q:A", , TRUE)
End If
The IF condition above will only resolve to true if you are running an UNPATCHED installation of IE6-WinXP. If you've added a patch, the version will be somewhere 6.0.2800.1106 (base IE6SP1) and 6.00.3663.0000 (IE6 for Windows Server 2003 RC1 Beta)
The same holds true for other versions. Patches will raise the version level to somewhere above the Base version number and below the base version number of the next release up.
So, to find the correct version of IE you must search for a RANGE of version numbers. This is best done using the AppSearch Table of the MSI, which accepts ranges. Wise simplifies the process with the Installation Expert - AppSearch section.
For a list of all version numbers of IE, refer to Microsoft Knowledgebase article Q164539 "How to Determine Which Version of IE is Installed".
I also found a few caveats. Although the Windows Installer docs say that the AppSearch range is inclusive (i.e. >=) it doesn't seem to be (i.e. just >). Also, the file that you should really be checking is Shdocvw.dll in System32. That's IE's primary dll and is what MS indicates as the true indicator of what IE version you're running.
Posted by:
plangton
20 years ago
Hi VikingLoki,
Thats funny, because I've found it will. Are you referring to patches to IE or IE on different Operating Systems? I wrote that script for IE6 on XP RTM - however, I have IE6 with XP SP1 installed and the file version is the same.
I've installed many IE patches and this version stays the same. Just tested it on a virtual PC< I installed about 4 hotfixes and rebooted, and the version of IE stays the same. Also installed XP SP1 and it stays the same.
Note that this is the FILE version (i.e. right click on the file iexplore.exe, click on the "version" tab) not a registry key or WMI identifier. This will not tell you what hotfixes are installed, just whether its IE5, IE6, IESP1 etc.
If you need to differentiate between IE on XP and IE on Windows Advanced Server 2003 RC, or another newer operating system then I'd suggest doing a WMI query on the OS first, or another way of determining the OS so you have an idea of what version of IE to expect.
Rgds
Paul
Thats funny, because I've found it will. Are you referring to patches to IE or IE on different Operating Systems? I wrote that script for IE6 on XP RTM - however, I have IE6 with XP SP1 installed and the file version is the same.
I've installed many IE patches and this version stays the same. Just tested it on a virtual PC< I installed about 4 hotfixes and rebooted, and the version of IE stays the same. Also installed XP SP1 and it stays the same.
Note that this is the FILE version (i.e. right click on the file iexplore.exe, click on the "version" tab) not a registry key or WMI identifier. This will not tell you what hotfixes are installed, just whether its IE5, IE6, IESP1 etc.
If you need to differentiate between IE on XP and IE on Windows Advanced Server 2003 RC, or another newer operating system then I'd suggest doing a WMI query on the OS first, or another way of determining the OS so you have an idea of what version of IE to expect.
Rgds
Paul
Posted by:
VikingLoki
20 years ago
You may want to pull up that KB article mentioned above. Microsoft does not recommend using the file version of iexplore.exe to determine IE version. You'd think it would be the way to go, but IE is no normal application. The true core file is Shdocvw.dll, part of the OS. That's why IE doesn't install with MSI and is patched with the OS patching process instead of MSPs.
Shdocvw.dll file version won't tell you what hotfixes are installed, but it will tell you the current true version number of IE.
Also, IE for Windows Server 2003 is actually a separate version of IE. There is IE6 (6.0.2600.0000), IE6SP1(6.0.2800.1106) and IE6 for Windows Server 2003(6.0.3790.0000). The KB article lists all IE versions for IE 3.0 to IE6 for Windows Server 2003, including betas.
Shdocvw.dll file version won't tell you what hotfixes are installed, but it will tell you the current true version number of IE.
Also, IE for Windows Server 2003 is actually a separate version of IE. There is IE6 (6.0.2600.0000), IE6SP1(6.0.2800.1106) and IE6 for Windows Server 2003(6.0.3790.0000). The KB article lists all IE versions for IE 3.0 to IE6 for Windows Server 2003, including betas.
Posted by:
plangton
20 years ago
Hi VikingLoki,
Well I read that article and it does indeed recommend using the shdocvw.dll - but I ran an extensive series of tests of several machines running various OS's and found that for each major upgrade of IE the version of the iexplore.exe changed correctly to reflect the update. So I'm not sure how my method, as you say "won't work".
I ran this on machines from Windows NT, 2000, XP, 2000 Advanced Server, and 2003 Advanced Server, with IE4.01, IE4SP1, IE4SP2, IE5, IE5SP1, IE5SP2, IE6, and IE6SP1.
However, you are right, its probably better to use the microsoft supported method of detecting IE. But the way I have been doing it will work for the versions of IE on the OS's I mentioned there.
Rgds
Paul
Well I read that article and it does indeed recommend using the shdocvw.dll - but I ran an extensive series of tests of several machines running various OS's and found that for each major upgrade of IE the version of the iexplore.exe changed correctly to reflect the update. So I'm not sure how my method, as you say "won't work".
I ran this on machines from Windows NT, 2000, XP, 2000 Advanced Server, and 2003 Advanced Server, with IE4.01, IE4SP1, IE4SP2, IE5, IE5SP1, IE5SP2, IE6, and IE6SP1.
However, you are right, its probably better to use the microsoft supported method of detecting IE. But the way I have been doing it will work for the versions of IE on the OS's I mentioned there.
Rgds
Paul
Posted by:
VikingLoki
20 years ago
Well, let me clarify. We run at a 1000:1 machine to hands-on support staff ratio here. Logic that works 98% of the time equates to "doesn't work" here. The failure rate will overwhelm support and the SLA won't be met. We're pretty extreme so your way may be a viable solution in other environments.
The part I like about shdocvw.dll version is that it IS updated with almost every IE patch. 1 Inventory report on shdocvw.dll version will tell you exactly how standardized your IE environment is, down to the patch level. Now I can send support a list of Rogues if they are not 100% compliant, down to patch level. Nip the problems in the bud.
Detection of IE within MSI is very easy through the AppSearch table which is designed for file version ranges. Wow, there IS some logic behind Microsoft's apparent chaos.
I can see that we live in different worlds because you actually have IE4xx, IE5xx, NT, 2000... a whole plethora of versions. (I don't even know where to get a copy of NT4/IE4 anymore) We don't have the staff to play around, we've reduced it to 4 OS/IE combinations among 10,000 machines.
It's like Henry Ford... You can have any IE version you want, as long as it's IE 6.0.2900.2518.
The part I like about shdocvw.dll version is that it IS updated with almost every IE patch. 1 Inventory report on shdocvw.dll version will tell you exactly how standardized your IE environment is, down to the patch level. Now I can send support a list of Rogues if they are not 100% compliant, down to patch level. Nip the problems in the bud.
Detection of IE within MSI is very easy through the AppSearch table which is designed for file version ranges. Wow, there IS some logic behind Microsoft's apparent chaos.
I can see that we live in different worlds because you actually have IE4xx, IE5xx, NT, 2000... a whole plethora of versions. (I don't even know where to get a copy of NT4/IE4 anymore) We don't have the staff to play around, we've reduced it to 4 OS/IE combinations among 10,000 machines.
It's like Henry Ford... You can have any IE version you want, as long as it's IE 6.0.2900.2518.
Posted by:
VikingLoki
20 years ago
Posted by:
sean_c_roberts
20 years ago
Posted by:
kkaminsk
20 years ago
Posted by:
kkaminsk
20 years ago
Posted by:
cdupuis
20 years ago
Not sure if this will help, but AdminStudio 6 has the IE 6 SP1 merge module included, it detects for prior versions then updates IE accordingly, maybe a good idea to make IE 6 SP1 a requirement of the package and force it on. The merge module is created by installshield (i think) and it may be avaialble for Installshield versions earlier than the new X version. Check the installshield site for avaialblility.
Posted by:
VikingLoki
20 years ago
Ugh. I was working off of the 164539 article, but the Shdocvw.dll version level is not consistent with the Help->About version.
Apparently it is possible for a hotfix to raise the Shdocvw.dll above the 6.0 SP1 version level, even though SP1 was never installed and Help->About does not indicate SP1. (It DOES list the patch that upped Shdocvw.dll to an SP1 version though)
Right now on my test machine Shdocvw.dll is 6.0.2800.1400 (SP1 is over 6.0.2800.1106) and Help->About says IE Version is "6.0.2600.0000.xpclient.010817-1148" ...all this because the MS04-004 - KB832894 patch was applied.
So... what SP level is my test machine at now, anway???
No wonder they hide away in that Richmond compound. They'd never make it home if they had a Manhattan office!
Apparently it is possible for a hotfix to raise the Shdocvw.dll above the 6.0 SP1 version level, even though SP1 was never installed and Help->About does not indicate SP1. (It DOES list the patch that upped Shdocvw.dll to an SP1 version though)
Right now on my test machine Shdocvw.dll is 6.0.2800.1400 (SP1 is over 6.0.2800.1106) and Help->About says IE Version is "6.0.2600.0000.xpclient.010817-1148" ...all this because the MS04-004 - KB832894 patch was applied.
So... what SP level is my test machine at now, anway???
No wonder they hide away in that Richmond compound. They'd never make it home if they had a Manhattan office!
Posted by:
kkaminsk
20 years ago
Posted by:
VikingLoki
20 years ago
Ok, from what I'm seeing Shdocvw.dll is the marker to trust since that's the primary dll. HOWEVER, I found out that it is possible to patch IE6 SP0 with an IE SP1 patch. That will bring Shdocvw.dll to SP1 version level without the full SP1 installed. Gotta be careful patching!
SO, if IE hasn't been screwed up with a bad patch and is straddling SP levels, IE is best detected by using the Signature table, referencing the above link "How to detect the version of IE". Define each version range in Signature (i.e. IE6SP0, IE6SP1, etc) define the file in DrLocator table and define the applicable properites in AppSearch table. This will make it so that if the version isn't installed, the property will be undefined.
With that done you will be able to add Custom Action code conditional on the property in AppSearch. (i.e. IF IE6SP0 Then...)
Of course, if you patched carelessly... You're screwed.
SO, if IE hasn't been screwed up with a bad patch and is straddling SP levels, IE is best detected by using the Signature table, referencing the above link "How to detect the version of IE". Define each version range in Signature (i.e. IE6SP0, IE6SP1, etc) define the file in DrLocator table and define the applicable properites in AppSearch table. This will make it so that if the version isn't installed, the property will be undefined.
With that done you will be able to add Custom Action code conditional on the property in AppSearch. (i.e. IF IE6SP0 Then...)
Of course, if you patched carelessly... You're screwed.
Posted by:
j0k3r
20 years ago
The problem with IE is there are so many controls and DLLs that can have independent versions, it is tough to get an accurate portrayal of what is actually installed. You can use WMI to retrieve this information though. You can use the MicrosoftIE_FileVersion class.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer _
& "\root\cimv2\Applications\MicrosoftIE")
Set colIESettings = objWMIService.ExecQuery _
("Select * from MicrosoftIE_FileVersion")
For Each strIESetting in colIESettings
Wscript.Echo "Company: " & strIESetting.Company
Wscript.Echo "Date: " & strIESetting.Date
Wscript.Echo "File name: " & strIESetting.File
Wscript.Echo "Path: " & strIESetting.Path
Wscript.Echo "File size: " & strIESetting.Size
Wscript.Echo "Version: " & strIESetting.Version
Next
Posted by:
plangton
20 years ago
I have done this many times, I simply wrote a vbscript to retrieve the version of the iexplore.exe.
Here is a copy of the script I used to detect the version of IE and run the relevant patches.
' Instantiate Objects required for File System Operations and Run Operations
Set FSO = CreateObject("Scripting.FileSystemObject")
Set SH = CreateObject("WScript.Shell")
' Get the version of Internet Explorer
IEVersion = FSO.GetFileVersion("C:\Program Files\Internet Explorer\iexplore.exe")
' If IE6SP1 then run the relevant patch
If IEVersion = "6.0.2800.1106" then
X = Sh.Run ("IE6.0-KB823353-WindowsXP-x86-ENU.exe /Q:A", , TRUE)
End If
If IEVersion = "6.0.2600.0" then
X = Sh.Run ("IE6.0sp1-KB823353-x86-ENU.exe /Q:A", , TRUE)
End if
'End Script
wscript.quit
Here is a copy of the script I used to detect the version of IE and run the relevant patches.
' Instantiate Objects required for File System Operations and Run Operations
Set FSO = CreateObject("Scripting.FileSystemObject")
Set SH = CreateObject("WScript.Shell")
' Get the version of Internet Explorer
IEVersion = FSO.GetFileVersion("C:\Program Files\Internet Explorer\iexplore.exe")
' If IE6SP1 then run the relevant patch
If IEVersion = "6.0.2800.1106" then
X = Sh.Run ("IE6.0-KB823353-WindowsXP-x86-ENU.exe /Q:A", , TRUE)
End If
If IEVersion = "6.0.2600.0" then
X = Sh.Run ("IE6.0sp1-KB823353-x86-ENU.exe /Q:A", , TRUE)
End if
'End Script
wscript.quit
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.