We created a batch file to deploy IE11.
Some of the notes:
- Used WSUS Offline Update utility to get the IE11 x86 & x64 installer .exe from a WSUS server, utility may work to get .exe from Windows Update too.
- The above installers will install the prerequisites, but if WindowsUpdate is disabled via GPO the script will enable access.
- Deployment will work if IE is open when packaged is deployed.
- IE will not reflect new version until reboot.
- Script detects if x86 or x64 and installs proper version.
- Script will fail out of unsupported OS
- Batch file accepts /<VARIABLE>:<VALUE>
- SD package procedures set to accept 0 & 9 as success exit codes.
- Procedure set to Reboot
- Procedure set to only run on Win7 Intel or higher.
----------------
:REM Detect x86 or x64 and install appropriate IE.
:REM Detect if IE already installed.
:REM Batch file output to ITCM job status.
SETLOCAL
SET PRODUCT=Internet_Explorer_11
SET PVER=11
IF DEFINED ProgramW6432 (SET PEXE=IE11-Win7-x64-en-us.exe) ELSE (SET PEXE=IE11-Win7-x86-en-us.exe)
SET EXELOG=IE11_main.log
SET INTACT=passive
SET REBOOT=norestart
SET CLOSE=closeprograms
SET UPDATE=update-yes
SET UPDATECL=
:checkparameters
:: REM Grab the first variable supplied as a whole. Ex. /scheduledexecution:On
set SWITCHPARSE=%1
:: REM Check to see if there are no more switches, if so goto end of parsing, prevents endless loop
IF [%SWITCHPARSE%] == [] goto endswitchparsing
:: REM Reset variables as clean up.
set SWITCH=
set VALUE=
:: In the SWITCHPARSE variable, grab the two tokens separated
:: by a : and assign the first to SWITCH and the second to VALUE
for /F "tokens=1,2 delims=: " %%a IN ("%SWITCHPARSE%") DO SET SWITCH=%%a&set VALUE=%%b
:: Set switch to value (removing 1st charcter / )
SET %SWITCH:~1%=%VALUE%
SHIFT
:: REM Reset variables as clean up.
set SWITCH=
set VALUE=
goto checkparameters
:endswitchparsing
IF %UPDATE%==update-no SET UPDATECL=/update-no
ECHO Windows Version:
echo ==================
VER
IF DEFINED ProgramW6432 (ECHO x64) ELSE (ECHO x86)
echo ==================
ECHO IE Version:
echo ==================
ECHO svcVersion better indicator, but doesn't exist on all IE version.
REG QUERY "HKLM\Software\Microsoft\Internet Explorer" | FIND "Version"
echo ==================
REG QUERY "HKLM\Software\Microsoft\Internet Explorer" /v "svcVersion" | FIND " %PVER%." >NUL
IF %ERRORLEVEL%==0 ECHO %PRODUCT% Detected. Marking as installed and quitting... & EXIT 9
:REM Unsupported OS outside of DSM requirements.
VER | FIND " 6.1.7600" >NUL
IF %ERRORLEVEL%==0 ECHO Win7-Srv2012R2 requires SP1 for this IE version. Marking as failed and quitting... & EXIT 14
VER | FIND "6.2." >NUL
IF %ERRORLEVEL%==0 ECHO Win8-Srv2012 does NOT support this IE version. Marking as failed and quitting... & EXIT 14
VER | FIND "6.3." >NUL
IF %ERRORLEVEL%==0 ECHO Win8.1-Srv2012R2 includes this IE version. Marking as failed and quitting... & EXIT 14
:REM Windows update needs to be enabled so requirements and updates can be installed.
REG QUERY HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate >%TEMP%\WindowsUpdate.LOG
REG ADD HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate /v DisableWindowsUpdateAccess /d 0 /t REG_DWORD /f >NUL
ECHO Installing with command %PEXE% /%INTACT% /%CLOSE% /%REBOOT% %UPDATECL%
%PEXE% /%INTACT% /%CLOSE% /%REBOOT% %UPDATECL%
SET /A IEINSTALL.ERROR=%ERRORLEVEL%
echo ==================
IF %IEINSTALL.ERROR%==3010 ECHO 3010 - A restart is required to complete the install of %PEXE% & SET /A IEINSTALL.ERROR=0
ECHO %IEINSTALL.ERROR% - Install errors
echo ==================
echo Output of %WINDIR%\%EXELOG%:
echo ==================
IF EXIST "%WINDIR%\%EXELOG%" TYPE "%WINDIR%\%EXELOG%"
echo ==================
ECHO Previous Registry Values for WindowsUpdate:
echo ==================
IF EXIST %TEMP%\WindowsUpdate.LOG TYPE %TEMP%\WindowsUpdate.LOG
echo ==================
ECHO Current Registry Values for WindowsUpdate:
echo ==================
REG QUERY HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate
echo ==================
IF EXIST %TEMP%\WindowsUpdate.LOG DEL /F %TEMP%\WindowsUpdate.LOG >NUL
EXIT %IEINSTALL.ERROR%
----------------