@ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION TITLE Windows Update Agent 2.0 (build: 5.8.0.2469) slipstreaming SET PREPDRV=%~d0 SET PREPDIR=%~dp0 set wuagnt20_txt=%~dp0\wuagnt20.log set dosnet_inf=%~dp0\dosnet.log set txtsetup_sif=%~dp0\txtsetup.log %PREPDRV% CD %PREPDIR% IF NOT EXIST TEMP MD TEMP :: Initialize variables SET CDROOT=C:\AI\SOURCE SET DOWNLOADER=J:\BuildCD\ZRMSCORP.FR\wget.exe SET BACKUP=backup :: required tools: :: CABARC.EXE from CAB SDK http://support.microsoft.com/default.aspx?scid=KB;en-us;310618& :: GNU WGet http://www.gnu.org/software/wget/wget.html :: STRINGS.EXE http://www.sysinternals.com/Utilities/Strings.html :: FVER.EXE http://internet.cybermesa.com/~bstewart/wast.html :: FINDSTR.EXE included in %SystemRoot%\system32 :: FIND.EXE included in %SystemRoot%\system32 :: MAKECAB.EXE included in %SystemRoot%\system32 :LOGGING if exist *.log del *.log ECHO.=========== Windows update Agent 2.0 (build: 5.8.0.2469) ===========>%wuagnt20_txt% :OS_VERSION ECHO.>>%wuagnt20_txt% ECHO.=========== Initializing static reporting data ===========>>%wuagnt20_txt% for /f "tokens=1-2* delims==," %%a in ('findstr /B /I "DriverVer=" %CDROOT%\I386\PRODSPEC.INI') do SET VER=%%~c SET SHORTVER=%VER:~0,3% for /f "tokens=1,2,3 eol=; delims= " %%a in ('findstr /L /I "%SHORTVER%" %~s0') DO ( SET WINOS=%%~b SET DLOS=%%~c ) ECHO.Ver = %VER%>>%wuagnt20_txt% :OS_LOCAL for /f "tokens=1,2,3* delims==," %%a in ('findstr /B /I "Product=" %CDROOT%\I386\PRODSPEC.INI') do SET Product="%%~b" ECHO.Product = !Product!>>%wuagnt20_txt% for /f "tokens=1* delims==" %%a in ('findstr /B /I "Localization=" %CDROOT%\I386\PRODSPEC.INI') do SET LOC="%%~b" for /f "tokens=2,3 eol=; delims= " %%i in ('findstr /L /I "%LOC%" %~s0') DO ( SET LOC2=%%~i SET LOC3=%%~j ) ECHO.Language = !LOC!>>%wuagnt20_txt% :: un-rem this line to skip download rem GOTO :WUSETUP :OS_DOWNLOAD if exist *.cab del *.cab ECHO.>>%wuagnt20_txt% ECHO.=========== Downloading client CABs ===========>>%wuagnt20_txt% for /f "tokens=1* skip=1 eol=;" %%a in ('findstr "http://download" %~s0') do call :Downloading "%%~a" :WUSETUP cabarc -o x wusetup.cab wusetup.inf if exist backup\*.* del backup\*.* /Q ECHO.>>%wuagnt20_txt% ECHO.=========== Installing client binaries ===========>>%wuagnt20_txt% :: Get the list of binary files from .inf file: wusetup.inf ://superseeded by cdob function// for /f "tokens=1* delims= " %%a in ('type wusetup.inf ^| find /i " = 1" ^| find /i "."') do call :Parse "%%~a" "%%~b" SET infname=wusetup.inf SET SectionHeader=SourceDisksFiles FOR /F "tokens=1 delims=:" %%i IN ( 'findstr /B /L /I /C:"[%SectionHeader%]" /N %infname%' ) DO (set sourcebegin=%%i) IF not defined sourcebegin GOTO :EOF FOR /F "tokens=1 delims=:" %%i IN ( 'findstr /B /L /I /C:"[" /N %infname% ^| FIND /V ":;"' ) DO ( IF %%i GTR %sourcebegin% ( set sourceend=%%i GOTO :exitloop) ) :exitloop FOR /F "tokens=1-2* delims==: " %%i IN ( 'findstr /L /I /C:" = 1" /N %infname%' ) DO (IF %%i GTR %sourcebegin% (IF %%i LSS %sourceend% (IF /I NOT %infname%==%%j set sourcefile=%%j) & (Call :Parse "%%~j")) ) GOTO :EOF del wusetup.inf IF EXIST TEMP RMDIR TEMP /S /Q goto :eof :Parse :: All OS: skip this binary file. IF "%~nx1"=="winhttp.dll" goto :EOF :: Win2003: newer version already in source. :: WinXP: slipstream newer winhttp.dll 5.1.2600.1557 included in KB842773 :: Additional steps (DLL register, TXTSETUP.SIF/DOSNET.INF edit) in this topic :: http://www.msfn.org/board/index.php?showtopic=49090&st=93# :: W2K: slipstream KB842773 :: W2K: slipstream newer msxml3.dll and msxml3r.dll included in KB###### :: Additional steps (DLL register, TXTSETUP.SIF/DOSNET.INF edit) not checked yet :: :: Extract binary file from cab SET CAB=%~n1 for %%a in (wuauhelp.chm wuau.adm) do if "%%a"=="%~nx1" SET CAB=wucltui cabarc x %cab%.cab %~nx1 :: Create a backup of binary file to update ::rem copy %CDROOT%\I386\%~n1.??_ %PREPDIR%%backup% if exist %CDROOT%\I386\%~n1.??_ ( expand -r %CDROOT%\I386\%~n1.??_ %PREPDIR%%backup% echo.Updating binary:>>%wuagnt20_txt% if /I "%~x1" EQU ".exe" (fver -f %~nx1 >>%wuagnt20_txt%) if /I "%~x1" EQU ".cpl" (fver -f %~nx1 >>%wuagnt20_txt%) if /I "%~x1" EQU ".dll" (fver -f %~nx1 >>%wuagnt20_txt%) if /I "%~x1" EQU ".chm" (echo.%~nx1 >>%wuagnt20_txt%) if /I "%~x1" EQU ".adm" (echo.%~nx1 >>%wuagnt20_txt%) ) if not exist %CDROOT%\I386\%~n1.??_ ( echo.Adding binary:>>%wuagnt20_txt% fver -f %~nx1 >>%wuagnt20_txt% :: Run this command to check if (newer) DLL needs registration for %%a in (%~nx1) do ( strings %%a | findstr /L /I "DLLRegisterServer">nul 2>&1&&echo.Registering binary: %%a required>>%wuagnt20_txt% ) ) :: Compress binary file in i386 makecab /D CompressionMemory=21 /D CompressionType=LZX /L %CDROOT%\I386 %~nx1 :: Delete uncompressed binary file del %~nx1 goto :eof :Downloading :: usage: DnldMgr URL %DOWNLOADER% %1 ECHO.%1 Download succeeded.>>%wuagnt20_txt% goto :eof [download] "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/cdm.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/iuengine.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wuapi.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wuauclt.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wuauclt1.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wuaucpl.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wuaueng.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wuaueng1.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wucltui.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wups.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wups2.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wusetup.cab?" "http://download.windowsupdate.com/v6/windowsupdate/b/selfupdate/AU/x86/%DLOS%/%LOC2%/wuweb.cab?" [LANG] "English" EN ENU "Arabic" AR ARA "Traditional Chinese" CN CHT "Simplified Chinese" CS CHS "Czech" CZ CZE "Dansk" DA DAN "German" DE DEU "„¢¢¤ ¡á" EL ELL "Español" ES ESP "Français" FR FRA "Finnish" FI FIN "Hebrew" HE HEB "Hungarian" HU HUN "Italiano" IT ITA "Japanese" JA JAP "Korean" KO KOR "Dutch" NL NLD "Norwegian" NO NOR "Polski" PL PLK "Português (Brasil)" PT-BR PTB "Português" PT PTG "Russian" RU RUS "Swedish" SV SVE "Türkçe" TR TRK "Trk‡e" TR TRK "Taiwan" TW TWN [OS] 5.0 W2K W2K 5.1 WinXP XP 5.2 Win2003 NetServer