IE Version Detection

July 3, 2010 at 06:06:35
Specs: Windows 7 Pro (64-bit)
Hi,
I have been working on a silent installer for
Flash Player 10.1 That works on Windows XP
32-bit, Windows Vista 32 & 64-bit, and
Windows 7 32 & 64-bit. Lucky enough they all
use the same installer. The problem that I
have is Windows XP comes with Internet
explorer 6 straight out of the box and Flash
Player 10.1 requires IE7. I am working on a
batch file to accomplish this. I found most of
the code here <a
href="http://www.computing.net/answers/progr
amming/ie-version-detection-
parsing/18890.html">

So, what I have thus far is:


SET KEY=Reg query
"HKLM\SOFTWARE\Microsoft\Internet
Explorer\Version Vector"
FOR /F "tokens=1 delims=" %%A in
('%KEY%' ) DO (
ECHO %%A
)
set alias=Reg query
"HKLM\SOFTWARE\Microsoft\Internet
Explorer\Version Vector"
FOR /F "TOKENS=3 DELIMS=. " %%A IN
('%alias%^|FIND /I "IE"') DO ECHO %%A


This works great to identify the version. I am
trying to add an IF command that allows me to
tell it IF IE6 is detected run (ie7 installer silent
then flash player installer silent) but IF ie7 or
above is detected run (flash player installer
silent).
I already have the switches for the installers
to make them silent I just am having trouble
with the IF command. Any assistance would
be awesome.


See More: IE Version Detection

Report •


#1
July 3, 2010 at 07:03:05
See if this will fit your bill:

::21840.bat
@ECHO OFF
SETLOCAL

SET KEY=Reg query "HKLM\SOFTWARE\Microsoft\Internet Explorer\Version Vector"
FOR /F "tokens=1 delims=" %%A in ('%KEY%' ) DO (
    ECHO %%A
)
set alias=Reg query "HKLM\SOFTWARE\Microsoft\Internet Explorer\Version Vector"
FOR /F "TOKENS=3 DELIMS=.	 " %%A IN ('%alias%^|FIND /I "IE"') DO SET IE_Version=%%A

IF %IE_Version% LEQ 6 (
    ECHO run ie7 installer silent then flash player installer silent
) ELSE (
    ECHO run flash player installer silent.
)
EXIT /B

I'm using LEQ (Less or Equal) 6 with the ELSE statement so if
IE_Version is greater than 7, just the flash player is installed. This
should account for IE version 8, 9, etc...

Insomniac at large


Report •

#2
July 3, 2010 at 08:56:20
that is exactly what I have been fighting to get working. Thank you very much. I fought with this for three days and within two hours of posting this you have it working just as i need. Thanks again

Report •

Related Solutions


Ask Question