Sunday, September 11, 2005

[Article] Integrating (Slipstreaming) Hotfixes for Windows XP and 2003

If you read my previous article you will have a nice off-line method for installing all the latest hot-fixes for Windows XP and 2003. This will mean you could reinstall your OS and then apply the hot-fixes without having to go online. This saves time but we can take it one step further and save even more time. How about making a new Windows CD that has all the hot-fixes already integrated? This will install a fully up-to-date Windows right from the CD.

I will provide a guide in this article how to make a CD for Windows XP and for Windows Server 2003. You can apply similiar techniques for Windows 2000, and also the 64 bit editions but I won’t detail them here.

What you need:

  • An existing Windows XP or Windows 2003 installation CD. If you haven’t got one then the rest of the article will be useless to you! If your computer only came with rescue CDs (typical for most OEM versions) then you are stuck too.
  • CD Writing software such as Nero. The built in XP one will not make a bootable CD.
  • Windows XP Service pack 2, or Windows 2003 Service Pack 1. Go here to get download links for the service packs.
  • The 32 hot-fixes for XP, or 13 hot-fixes for 2003. Go here to get the download list of the hot-fixes.
  • The Boot image of the CD. You can use IsoBuster in free mode to read the boot image

So if you have all these you can follow the next instructions.

Copy the CD to hard disc

Copy the contents of the Windows CD to a directory on your hard disc. For the rest of the article I will use the locations C:\XP and C:\2003 for the locations the files were copied. There should be a directory called I386 which is off the root of the CD. If this is not the case then you probably have some multi boot CD such as an MSDN one, this requires a little bit more work as the directory references will be wrong.

A quick guide for MSDN discs: Copy the directory that looks like the image you want (eg the 2003 CD probably has Standard Edition, and Enterprise Edition on the same disc, there will be an obvious directory). Ignore the high level directories, you want the big one that contains I386. There is a text file you need to edit which I believe is txtsetup.sif. There is a line in there that says something about SourceDirectory which will contain the original path on the CD, change this to “\”. You will also need to get hold of a plain Windows CD Boot Image.

Get boot image of CD

Use IsoBuster to read the boot image off the CD. It is generally called “Microsoft Corporation.img”. You might want to rename the extension to .ima for Nero (newer versions use .ima, older use .img). Note: If you have used an MSDN multi boot CD, then you need to get a CD boot image that only has one OS version on it. If you have MSDN you are will have a CD that fits the bill. It can be any XP or 2003 CD, the boot image is all the same.

Note: you don’t have to pay for IsoBuster. It has a free mode which has reduced features. The feature of reading the boot image is free. Sadly you can’t use Nero to read the boot image, this is the only thing that Nero doesn’t do when it comes to CDs and DVDs. A pity.

Make sure you have a directory with the files you need

I am assuming you have downloaded the Service Pack files you need and all the hot-fixes. Lets say you have put them in the directory C:\Dump.

Integrate the Service Pack

I am assuming your CD was a Base version of XP or 2003. You may have one that already has the Service pack in it (eg if the CD says: “Windows XP Professional with Service Pack 2” then this bit is already done for you!).

Now run cmd (ie a command shell window). Make sure you are in the directory C:\Dump.

For Windows XP run
WindowsXP-KB835935-SP2-ENU.exe /integrate:C:\XP

For Windows 2003 run
WindowsServer2003-KB889101-SP1-x86-ENU.exe /integrate:C:\2003

These operations will take a while to run, hopefully they will say success at the end.

Integrate the hot-fixes for Windows 2003

There are only 13 of these hot-fixes at the moment and they are straight forward. For each hot-fix use the command line:
/integrate:C:\2003 /passive

The passive flag means it won’t prompt you. I recommend using a batch file. Create a batch file with the following lines in it:

WindowsServer2003-KB896422-x86-enu.exe /integrate:C:\2003 /passive
WindowsServer2003-KB896358-x86-enu.exe /integrate:C:\2003 /passive   
WindowsServer2003-KB890046-x86-enu.exe /integrate:C:\2003 /passive
WindowsServer2003-KB896428-x86-enu.exe /integrate:C:\2003 /passive
WindowsServer2003-KB883939-x86-enu.exe /integrate:C:\2003 /passive
WindowsServer2003-KB898792-v2-x86-enu.exe  /integrate:C:\2003 /passive
WindowsServer2003-KB903235-x86-ENU.exe /integrate:C:\2003 /passive
WindowsServer2003-KB901214-x86-ENU.exe /integrate:C:\2003 /passive
WindowsServer2003-KB893756-x86-ENU.exe /integrate:C:\2003 /passive
WindowsServer2003-KB899591-x86-ENU.exe /integrate:C:\2003 /passive
WindowsServer2003-KB899587-x86-ENU.exe /integrate:C:\2003 /passive
WindowsServer2003-KB896727-x86-ENU.exe /integrate:C:\2003 /passive
WindowsServer2003-KB899588-x86-ENU.exe /integrate:C:\2003 /passive

Put the batch file in the directory with the hot-fixes and run it.

Integrate the hot-fixes for Windows XP

This is harder than for 2003. There are currently 32 hot-fixes since SP2 for XP. There are two hot-fixes that conflict with each other

The problem hot-fixes are KB885835 and KB885250. The issue here is that they both try to update the file mrxsmb.sys, and the integration process does not like this. KB885835 only changes mrxsmb.sys with a version older than KB885250, so it completely superseded by KB885250. However if you don’t install it then windows update will see you haven’t got it and will say you require an update. If you do the update it will apply the hot-fix, but not actually replace the mrxsmb.sys file as the version currently on will be later anyway. So what will actually be applied? Nothing except the registry entries to say that the hot-fix is applied!

We can achieve the same thing in integration. We can get both hot-fixes “integrated”, however KB885835 will only be there in name, its one file already superseded by KB8825250.

KB885835 should be integrated first, then the file C:\XP\I386\svcpack\HFINT.DAT must be edited. The line that says mrxsmb.sys should be modified to something else, for example: mrxsmb.sys.temp. Then KB885250 can be integrated. The line in HFINT.DAT should be changed back to the original again. The remaining 30 hot-fixes can be integrated without problem.

To integrate a hot-fix the syntax is the same as for 2003:
/integrate:C:\XP /passive

Once again I recommend a batch file. Especially as we can automate the tweaking of HFINT.DAT.

Put the following into a batch file (I called it IntegrateAll.bat). Execute the batch file with the command:
IntegrateAll C:\XP

@Echo off
rem ////////////////////////////////////////////////////////////////////////////
rem // IntegrateAll.bat
rem // This Batch file integrates the hotfixes for Windows XP SP2
rem // Syntax:
rem //   IntegrateAll <DistributionFolder>
rem ////////////////////////////////////////////////////////////////////////////

if "%~1" == "-p" goto Process

rem ////////////////////////////////////////////////////////////////////////////
rem // Main routine
rem // %1 contains Options
rem //

rem //
rem // Verify that we are pointing to a distribution folder base
rem //
if exist "%~1\I386" goto FolderExists

echo -- "%~1" is not a distribution folder.
echo Syntax:
echo   IntegrateAll ^<DistributionFolder^>
goto END

:FolderExists

echo ::: Integrating Updates :::

set DISTDIR="%~1"
set HFINT="%~1\i386\svcpack\HFINT.DAT"
set HFINTTEMP="%~1\i386\svcpack\HFINT.TMP"

rem //
rem // Do 885835 and then 885250 to start with. There is a conflict here. So
rem // we need to do some special processing. Note: 885835 is superceeded by
rem // 885250 but we want an entry so that the hotfix show as installed
rem //
call %0 -p KB885835 "WindowsXP-KB885835-x86-ENU.exe"

rem // Modify the line mrxsmb.sys (change it to mrxsmb.sys.tmp)
for /f "usebackq" %%L in (%HFINT%) DO (
 if %%L==mrxsmb.sys (
  echo %%L.tmp>>%HFINTTEMP%
 ) else (
  echo %%L>>%HFINTTEMP% )
)
move /y %HFINTTEMP% %HFINT% > NUL

rem // Integrate 85250 
call %0 -p KB885250 "WindowsXP-KB885250-x86-ENU.exe"

rem // Modify the line back (change the mrxsmb.sys.tmp back to mrxsmb.sys)
for /f "usebackq" %%L in (%HFINT%) DO (
 if %%L==mrxsmb.sys.tmp ( 
  echo mrxsmb.sys>>%HFINTTEMP%
 ) else (
   echo %%L>>%HFINTTEMP%
 )
)
move /y %HFINTTEMP% %HFINT% > NUL

rem //
rem // Now integrate all the rest of the hotfixes.

call %0 -p KB888302 "WindowsXP-KB888302-x86-ENU.exe"
call %0 -p KB887472 "WindowsXP-KB887472-x86-enu.exe"
call %0 -p KB891781 "WindowsXP-KB891781-x86-ENU.exe"
call %0 -p KB888113 "WindowsXP-KB888113-x86-ENU.exe"
call %0 -p KB867282 "WindowsXP-KB867282-x86-ENU.exe"
call %0 -p KB873333 "WindowsXP-KB873333-x86-ENU.exe"
call %0 -p KB890175 "WindowsXP-KB890175-x86-ENU.exe"
call %0 -p KB886185 "WindowsXP-KB886185-x86-enu.exe"
call %0 -p KB885836 "WindowsXP-KB885836-x86-ENU.exe"
call %0 -p KB873339 "WindowsXP-KB873339-x86-ENU.exe"
call %0 -p KB887742 "WindowsXP-KB887742-x86-ENU.exe"

call %0 -p KB883939 "WindowsXP-KB883939-x86-ENU.exe"
call %0 -p KB890046 "WindowsXP-KB890046-x86-ENU.exe"
call %0 -p KB890859 "WindowsXP-KB890859-x86-ENU.exe"
call %0 -p KB893066 "WindowsXP-KB893066-v2-x86-ENU.exe"
call %0 -p KB893086 "WindowsXP-KB893086-x86-ENU.exe"
call %0 -p KB896358 "WindowsXP-KB896358-x86-ENU.exe"
call %0 -p KB896422 "WindowsXP-KB896422-x86-ENU.exe"
call %0 -p KB896428 "WindowsXP-KB896428-x86-ENU.exe"
call %0 -p KB898461 "WindowsXP-KB898461-x86-ENU.exe"
call %0 -p KB903235 "WindowsXP-KB903235-x86-ENU.exe"
call %0 -p KB901214 "WindowsXP-KB901214-x86-ENU.exe"
call %0 -p KB893803v2 "WindowsInstaller-KB893803-v2-x86.exe"
call %0 -p KB896727 "WindowsXP-KB896727-x86-ENU.exe"
call %0 -p KB899587 "WindowsXP-KB899587-x86-ENU.exe"
call %0 -p KB894391 "WindowsXP-KB894391-x86-ENU.exe"
call %0 -p KB899588 "WindowsXP-KB899588-x86-ENU.exe"
call %0 -p KB896423 "WindowsXP-KB896423-x86-ENU.exe"
call %0 -p KB899591 "WindowsXP-KB899591-x86-ENU.exe"
call %0 -p KB893756 "WindowsXP-KB893756-x86-ENU.exe"

echo.
echo ::: Done :::
echo.

goto END

rem ////////////////////////////////////////////////////////////////////////////
rem ////////////////////////////////////////////////////////////////////////////
:Process
rem //
rem // %2 will contain the KB number
rem // %3 will contain the Exe file name
rem //

echo Integrating %2
"%~3" /integrate:%DISTDIR% /passive

:EndProcess
goto END

rem ////////////////////////////////////////////////////////////////////////////

:END

Write the CD

I recommend Nero however you should be able to use other packages to achieve the same thing. I recommend you put a copy of the Microsoft Corporation.ima Boot image file in the C:\XP and C:\2003 directories. This way you don’t have to extract it next time you want to add some more hotfixes.

Create a “Bootable CD”. Use “Microsoft Corporation.ima” as the Image File. Then select Expect features (This is important otherwise you will end up with a non bootable CD) and choose “No emulation” (in the section “Kind of emulation”. For “Number of loaded Sectors” choose 4. The “Load segment of sectors” default of “07C0” should be left.

Put the directory contents of C:\XP or C:\2003 in the root of the CD image. Choose a sensible volume label (Try to indicate SP and the number hot-fixes, its hard because you only get 16 characters. I use things like XP_PRO_SP2_32HF and 2003ENT_SP1_13HF).

If you have Vmware I recommend writting this to a .iso file and trying it in Vmware, saves ruining a CD-R if you got something wrong.When you are happy write it to an actual CD-R and make sure you print on a beautiful label. Don’t go scribbling on with a felt pen, use a printable CD-R or print on a CD label and stick it on. Technically this is not required to integrate the hotfixes, but I don’t want to know of any ugly CD-Rs out there.

The Future

When new hot-fixes come out you can take the latest CD you have made, copy the files to hard disc, apply the new hot-fixes (with the /intergate option) and write a new CD-R.

I will update this article as new hotfixes come out.

 

2 Comments:

At Fri Jan 13, 11:22:04 PM NZDT, Anonymous said...

great work and guide.

question #1: in the "IntegrateAll.bat" file, you write "DistributionFolder". The Distribution Folder is the folder where I download my hotfixes?

question #2: can I integrate the hotfixes ordered by kb number or is not important?

question #3: if my CD directory is C:\XPCD and my folder with all hotfixes is C:\HOTFIXES, I should change anything in the "IntegrateAll.bat" file?

sorry for my bad english
many thanks
Luciano

 
At Sat Jan 14, 12:30:17 AM NZDT, microzozz said...

great work and guide.

question #1: in the "IntegrateAll.bat" file, you write "DistributionFolder". The Distribution Folder is the folder where I download my hotfixes?

question #2: can I integrate the hotfixes ordered by kb number or is not important?

question #3: if my CD directory is C:\XPCD and my folder with all hotfixes is C:\HOTFIXES, I should change anything in the "IntegrateAll.bat" file?

sorry for my bad english
many thanks
Luciano

 

Post a Comment

<< Home