Обновленный скрипт (от 25.02.2009) для сборника обновлений [more=тут...]
Код: @echo off
SetLocal EnableExtensions
SetLocal EnableDelayedExpansion
rem Links to official release:
rem
http://torrents.ru/forum/viewtopic.php?t=1504109 rem
http://nnm-club.ru/forum/viewtopic.php?t=111624 Title=PreSp4 Technics Pack
rem start /WAIT /MIN .\Tools\nircmd.exe win hide title "PreSp4 Technics Pack"
start .\Tools\nircmd.exe infobox "Установка запущена в фоновом режиме..." " PreSP4 (Technics Pack) (Ru) "
start /WAIT /MIN .\Tools\nircmd.exe beep 1500 3000
start /WAIT /MIN .\Tools\nircmd.exe win settopmost title " PreSP4 (Technics Pack) (Ru) " 1
set delay_3_sec=start /wait /min .\Tools\nircmd.exe wait 3000
set MainSwitches=/quiet /norestart
set OldSwitches=/Q
set detect_NET=HKLM\SOFTWARE\Microsoft\Updates\Microsoft .NET Framework 3.5 SP1
set detect_KB954550=HKLM\SOFTWARE\Microsoft\Updates\Windows XP\SP4\KB954550-v5\Filelist\0
set detect_KB923789=%WINDIR%\system32\Macromed\Flash\KB923789.inf
set detect_WUA=%WINDIR%\system32\SoftwareDistribution\Setup\ServiceStartup\wups.dll\7.2.6001.788
set detect_VC05=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7299052b-02a4-4627-81f2-1818da5d550d}
set detect_VC08=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9A25302D-30C0-39D9-BD6F-21E6EC160475}
set detect_rootsupd=HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{EF289A85-8E57-408d-BE47-73B55609861A}
set detect_ver_rootsupd=0
set cur_ver_rootsupd=20,0,2195,0
set NetStop=start /high /wait /min sc stop clr_optimization_v2.0.50727_32 >nul
echo Date of installation: %time:~,-6% %date%>>%SystemDrive%\Installed_Updates.log&echo Date of detection: %time:~,-6% %date%>>%SystemDrive%\Detected_Updates.log
echo.>>%SystemDrive%\Installed_Updates.log&echo.>>%SystemDrive%\Detected_Updates.log
start /high /wait regedit /s .\Tools\HideFileExt.reg
start /high /wait regedit /s .\Tools\DisableSR.reg
start /high /wait sc stop srservice >nul
reg query "%detect_NET%" 1>nul 2>&1
IF %ERRORLEVEL%==1 (
%delay_3_sec%
start /wait .\dotnetfx35\dotnetfx35langpack_x86ru.exe
echo dotnetfx35langpack_x86ru>>%SystemDrive%\Installed_Updates.log
start /wait .\dotnetfx35\dotnetfx35.exe %MainSwitches% /nopatch /lang:RUS
echo dotnetfx35 %MainSwitches% /nopatch /lang:RUS>>%SystemDrive%\Installed_Updates.log
%delay_3_sec%&%NetStop%
start /wait .\dotnetfx35\ndp20sp2-kb958481-x86.exe %MainSwitches%
echo ndp20sp2 %MainSwitches%>>%SystemDrive%\Installed_Updates.log
%delay_3_sec%&%NetStop%
start /wait .\dotnetfx35\ndp30sp2-kb958483-x86.exe %MainSwitches%
echo ndp30sp2 %MainSwitches%>>%SystemDrive%\Installed_Updates.log
%delay_3_sec%&%NetStop%
start /wait .\dotnetfx35\ndp35sp1-kb958484-x86.exe %MainSwitches%
echo ndp35sp1 %MainSwitches%>>%SystemDrive%\Installed_Updates.log
%delay_3_sec%&%NetStop%
rem Скрываем (удаляем) папку которую оставляет инсталлятор .NET Framework 3.5
for /f "tokens=3" %%k in ('reg query "%detect_KB954550%" /v Location') do set NetPath=%%~dk%%~pk
rem rd /S /Q "!NetPath:~,-1!"
attrib +h !NetPath:~,-1!
%delay_3_sec%
) ELSE (echo .NET Framework 3.5 SP1 detected in %detect_NET%>>%SystemDrive%\Detected_Updates.log)
for /F "tokens=1,* delims= " %%k in (.\Config\KB.txt) do call :KBInst "%%k" "%%l"
reg query "HKLM\SOFTWARE\Microsoft\Updates\Windows XP\SP0\ie7" 1>nul 2>&1
IF %ERRORLEVEL%==0 (
start /wait regedit /s .\IE7\DDL_IE7.reg
start /wait /min .\Tools\nircmd.exe shellrefresh
start /wait .\IE7\IElnk.exe
)
IF EXIST .\KBxxxxxx\KB905474.exe IF EXIST .\WGA\WGAUpdate.exe start /wait .\WGA\WGAUpdate.exe
for /f "tokens=3 delims= " %%v in ('reg query "%detect_rootsupd%" /v Version') do set detect_ver_rootsupd=%%v
IF NOT "%detect_ver_rootsupd%"=="%cur_ver_rootsupd%" (.\Other\rootsupd.exe %OldSwitches%&echo Windows Roots Update %OldSwitches% - ver:"%cur_ver_rootsupd%">>%SystemDrive%\Installed_Updates.log
) ELSE echo Windows Roots Update detected in %detect_rootsupd%>>%SystemDrive%\Detected_Updates.log
reg query "%detect_VC05%" 1>nul 2>&1
IF %ERRORLEVEL%==1 (
start /wait .\VC++\vcredist_x86_2005.exe %OldSwitches%
echo VC++ 2005 %OldSwitches%>>%SystemDrive%\Installed_Updates.log
%delay_3_sec%
) ELSE echo VC++ 2005 detected in %detect_VC05%>>%SystemDrive%\Detected_Updates.log
reg query "%detect_VC08%" 1>nul 2>&1
IF %ERRORLEVEL%==1 (
start /wait .\VC++\vcredist_x86_2008.exe %OldSwitches%
echo VC++ 2008 %OldSwitches%>>%SystemDrive%\Installed_Updates.log
%delay_3_sec%
) ELSE echo VC++ 2008 detected in %detect_VC08%>>%SystemDrive%\Detected_Updates.log
echo.>>%SystemDrive%\Installed_Updates.log&echo.>>%SystemDrive%\Installed_Updates.log&echo.>>%SystemDrive%\Detected_Updates.log&echo.>>%SystemDrive%\Detected_Updates.log
start /WAIT /MIN .\Tools\nircmd.exe win close title " PreSP4 (Technics Pack) (Ru) "
start .\Tools\nircmd.exe infobox "Выполняется подготовка к перезагрузке (~10 сек)..." " PreSP4 (Technics Pack) (Ru) "
start /WAIT /MIN .\Tools\nircmd.exe beep 200 800
start /WAIT /MIN .\Tools\NirCmdInst.exe
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce /v ReadyPreSP4 /t REG_SZ /d "%SystemRoot%\TEMP\nircmd.exe infobox \"Установка завершена...\" \" PreSP4 (Technics Pack) (Ru) \"" /f >nul
start /B %SystemRoot%\TEMP\nircmd.exe cmdwait 10000 exitwin reboot forceifhung
exit
:KBInst
set number=%~1
set UserSwitches=No
if NOT %2=="" set UserSwitches=%~2
set detect_key=0
IF %number%==KB923789 IF EXIST "%detect_KB923789%" echo %number% detected in %detect_KB923789%>>%SystemDrive%\Detected_Updates.log&goto :EOF
IF %number%==KB946648 IF NOT EXIST "%ProgramFiles%\Messenger\msgsc.dll" goto :EOF
IF %number:~,18%==windowsupdateagent IF EXIST %detect_WUA% echo %number% detected in %detect_WUA%>>%SystemDrive%\Detected_Updates.log&goto :EOF
IF %number:~,3%==wua IF EXIST %detect_WUA% echo %number% detected in %detect_WUA%>>%SystemDrive%\Detected_Updates.log&goto :EOF
IF %number%==KB905474 IF NOT EXIST ".\KBxxxxxx\KB905474.exe" goto :EOF
for /F "tokens=*" %%l in (.\Config\RegKeys.txt) do (
reg query "%%l" 1>nul 2>&1
IF !ERRORLEVEL!==0 set detect_key=1&echo !number! detected in %%l>>%SystemDrive%\Detected_Updates.log
)
IF !detect_key!==0 (
%delay_3_sec%
IF !UserSwitches!==No (
start /wait .\KBxxxxxx\%number%.exe %MainSwitches%
echo %number% %MainSwitches%>>%SystemDrive%\Installed_Updates.log
goto :EOF
) ELSE (
start /wait .\KBxxxxxx\%number%.exe !UserSwitches!
echo %number% !UserSwitches!>>%SystemDrive%\Installed_Updates.log
goto :EOF
)
)
goto :EOF