Space Surfer Posted April 9, 2007 Posted April 9, 2007 (edited) How to Integrate Vista UpdatesThis guide shows you how to integrate Vista updates to the installation source, which is install.wim. Much of the credit for this guide goes to FireGeier. His site contains a lot of useful visual guides for automating Vista installations. It is found here: FireGeier's Unattended Vista Guide.Although others have used peimg.exe, official documentation from Microsoft's WAIK is lacking. Therefore, methods described here use Package Manager. The only place peimg.exe is used in this guide is to create a text file that lists the packages that were integrated.RequirementsWAIK tools (imagex.exe, pkgmgr.exe, and supporting files); you should leave these files in the install folder (%programfiles%\Windows AIK\) and not copy them to another location. Run them from their original location so all dll's that are necessary are there.Vista DVDISO extractorAlthough Windows XP is not required and you can do this in Vista, I had trouble mounting images in Vista. Therefore, I was working in Windows XP.PreparationCreate a folder called 'Vista_Work'. You can call it anything you want. I have assigned it a variable %vpath% in my script so I'll refer to it as %vpath% from now on.Create folders in %vpath% called Mount, Sandbox, Updates, and Current_ISO. I've assigned them the variables %vmount%, %vsandbox%, and %vupdates%, respectively.ProcedureBoot to the OS that has WAIK installed. If you installed it in Vista, you'll need to run these scripts in elevated mode.Extract install.wim from Vista installation DVD to %vpath%.Create script file called set_variables.cmd, integrate.cmd and expand.cmd in %vpath% from the following code or download them from the links:The script set_variables.cmd allows you to skip editing the scripts with your working folders path (%vpath%). They are automatically assigned based on the current working folder.You may have to change the tokens value in expand.cmd, if you are not using the English version. Change tokens=5 to tokens=4 if that's the case. If you are unsure, leave it and continue, as no damage is done. Only your Integrate.xml will not be properly formed. You'll determine if it is improperly formed in a later step.Download:Integration_batch_files.rarset_variables.com:: As long as all your folders are within one folder, you shouldn't have to change:: these paths since this batch file will assign the paths based on where :: set_variables.cmd is located. This script is called by expand.cmd & integrate.cmd:: Also, the Windows AIK folders are added to the path so you can run imagex, expand,:: and pkgmgr without pointing to those paths.@echo offCD /d %~dp0SET vpath=%CD%SET vmount=%vpath%\MountSET vupdates=%vpath%\UpdatesSET vsandbox=%vpath%\SandboxSET path=%path%;C:\Program Files\Windows AIK\Tools\x86;C:\Program Files\Windows AIK\Tools\Servicingexpand.cmd (courtesy of FireGeier)@echo offTITLE Vista Updates Expansion Processecho.:: As long as you are this script, integrate.cmd and expand.cmd are in the:: same folder, you will not have ot change your paths.CD /d %~dp0call set_variables.cmdecho.echo Your vpath is %vpath%. If this is correct, continue.echo.pause:: Create an temporary to store expanded cab and xml files from msu files.IF NOT EXIST "%vupdates%\Temp" (MKDIR "%VUpdates%\Temp")DEL "%vupdates%\Temp\*.*" /qPUSHD "%vupdates%"FOR %%i IN (*) DO (Call :Extract %%i):: Check for older file versions created by this batch and delete if exists.IF EXIST "%vupdates%\Temp\Integrate.xml" DEL /Q "%vupdates%\Temp\Integrate.xml"IF EXIST "%vupdates%\Temp\Sort.txt" DEL /Q "%vupdates%\Temp\Sort.txt":: Create the first 3 lines of Integrate.xmlECHO ^<^?xml version="1.0" encoding="utf-8"?^>^ >>%VUpdates%\Temp\Integrate.xmlECHO ^<^unattend xmlns="urn:schemas-microsoft-com:unattend"^>^ >>%VUpdates%\Temp\Integrate.xmlECHO ^<^servicing^>^ >>%VUpdates%\Temp\Integrate.xml:: Create sort.txt which is necessary for compiling Integrate.xml.PUSHD "%vupdates%\Temp"del *.txtdel WSUSSCAN.cabDir /OD > Sort.txtFor /F "Tokens=5" %%i IN ('FINDSTR ".cab" Sort.txt') DO Call :WriteXML %%i:: Create the last two lines of Integrate.xml.ECHO ^<^/servicing^>^ >>%VUpdates%\Temp\Integrate.xmlECHO ^<^/unattend^>^ >>%VUpdates%\Temp\Integrate.xmlecho.echo Finished extracting MSU's and compiling Integrate.xml.echo Check Integrate.xml to see if it is well-formed before continuingecho to use Integrate.cmd to begin the integration process.echo.pause::----------------------------------------------------------------------------:: SUB PROCEDURES & PARTS EXECUTED OPTIONAL::----------------------------------------------------------------------------:: Extract subroutine extracts the msu files for the necessary cab and xml files.:ExtractSTART "Expand" /WAIT expand.exe %1 -f:* "%vupdates%\Temp"GOTO :EOF:: WriteXML subroutine writes entries into Integrate.xml, which are specified by the name of:: coresponding cab file. This is the command line, which will call the installation of the:: cab during pkgmgr procedure later.:WriteXMLIF "%1"=="WSUSSCAN.cab" Goto :EOFSET Name=%1IF ".%Name%"=="." GOTO :EOFSET XML=%Name:~0,-4%.xmlSET Cab=%Name:~0,-4%.cabECHO ^<^package action="install"^>^ >>%vupdates%\Temp\Integrate.xmlFOR /F "Tokens=*" %%i IN ('FINDSTR "assemblyIdentity" %XML%') DO (Echo %%i >>%vupdates%\Temp\Integrate.xml)ECHO ^<^source location="%vupdates%\Temp\%Cab%" /^>^ >>%VUpdates%\Temp\Integrate.xmlECHO ^<^/package^>^ >>%vupdates%\Temp\Integrate.xml:EOFIntegrate.cmd@echo offTITLE Vista Updates Integration ProcessCD /d %~dp0call set_variables.cmdecho.echo Your vpath is %vpath%. If this is correct, continue.echo.pauseecho.echo Before beginning, please choose the version of Vista you want to update.echo.:SELECT_VERset choice=set /p choice=Choose 1 for Business, 2 for HomeBasic, 3 for HomePremium, or 4 for Ultimate: if not '%choice%'=='' set choice=%choice:~0,1%if '%choice%'=='1' goto BUSif '%choice%'=='2' goto HBif '%choice%'=='3' goto HPif '%choice%'=='4' goto ULTecho.ECHO "%choice%" invalid! Try again...ECHO.GOTO SELECT_VER:BUSSET VERSION=1SET type=BusinessGOTO STEP_1:HBSET VERSION=2SET type=HomeBasicGOTO STEP_1:HPSET VERSION=3SET type=HomePremiumGOTO STEP_1:ULTSET VERSION=4SET type=UltimateGOTO STEP_1:STEP_1REM MOUNT A READ-WRITE IMAGE OF THE CHOSEN VISTA VERSIONimagex.exe /mountrw "%vpath%\install.wim" %VERSION% "%vmount%"ECHO.ECHO Press any key to begin integration of updates. Once you start the process.echo you should not cancel it. Make sure you are ready before continuing.echo.PAUSEecho Starting integration. This can take several minutes. Please wait until it finishes.echo onSTART "Starting Package Manager" /WAIT pkgmgr.exe /o:"%vmount%;%vmount%\Windows" /n:"%vupdates%\Temp\Integrate.xml" /s:"%vsandbox%" /l:"%vpath%\integrate.txt"echo.echo The errorlevel is: %errorlevel%.echo.echo An errorlevel of 0 indicates successful integration. Press any key to save a echo list of installed packages to a text file.ECHO.pauseecho offpeimg.exe /list /image="%vmount%\Windows" >> "%vpath%\Current_ISO\updates_installed_%version%_%type%.txt"echo.echo The Sandbox folder should be cleared whether integration was successful or not.echo.pauseREM Delete, then recreate the folderrd "%vsandbox%" /s /qmkdir "%vsandbox%"echo.echo Now, we are ready to commit changes and unmount. Selection an option to echo unmount while committing or not committing changes.echo.echo Once you commit, the process can take several minutes as the changes areecho saved to your installation source.ECHO.:SELECT_COMMITset choice=set /p choice=Choose Y to commit changes. Choose N to abandon changes: if not '%choice%'=='' set choice=%choice:~0,1%if '%choice%'=='Y' goto COMMITif '%choice%'=='y' goto COMMITif '%choice%'=='N' goto ABANDONif '%choice%'=='n' goto ABANDONecho.ECHO "%choice%" invalid! Try again...ECHO.GOTO SELECT_COMMIT:COMMITimagex.exe /unmount /commit "%vmount%"goto END:ABANDONimagex.exe /unmount "%vmount%"goto end:ENDecho.echo Done. Press any key to exit.echo.Pause[*]Copy all of your MSU updates to the %vupdates% folder.[*]Execute expand.cmd.Expand.cmd will extract the .cab and .xml files from the .msu files in a temporary folder called Temp in %vupdates%. It also compiles a file called Integrate.xml, a necessary file for integration.Note: do not change the spacing in expand.cmd. Some spaces are necessary to build a proper structure for Integrate.xml.[*]Examine this file (Integrate.xml) using Notepad. It should have as many entries as there are updates of the following nature:Integrate.xml sample (partial)<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <servicing> <package action="install"> <assemblyIdentity name="Package_for_KB928089" version="6.0.1.1" language="neutral" processorArchitecture="x86" publicKeyToken="xxxxxxxxxxxxxxx"/> <source location="E:\Vista_Work\Updates\Temp\Windows6.0-KB928089-x86.cab" /> </package>...and so on If your file is bare, you may need to change tokens=5 to tokens=4 in expand.cmd.[*]Execute integrate.cmd once you determine your xml is good. It will prompt you through the steps.Note that if you were successful, you should get an errorlevel of 0.The script will also create a file called Updates_Installed_%#%_%type%.txt, where # and type correspond to the Vista version number (1 to 4) and type (Business, Home Basic, Home Premium, or Ultimate), respectively. This is only for the purpose of auto-generating a text file that shows all the updates. The official way of checking integrated updates is described in step 8.NOTE: You will have to install updates to each version of Vista separately. So, you can repeat integrate.cmd for each version by running integrate.cmd and choosing to mount a different version.NOTE: You don't have to repeat expand.cmd for each version, only integrate.cmd. The script empties the Sandbox folder automatically but does not delete the cab files that are expanded in Temp folder. You can manually delete the cab files later if you prefer.[*]Start WSIM and open your updated install.wim. If you are asked to create a new catalog file as the current one is missing or outdated, go ahead and create a new catalog file. You will see your packages automatically assigned as either hotfixes, updates, or security updates in the directory structure of Packages.NOTE: This is the official method to check whether your packages were installed. We used peimg only to make a text file that does that automatically for step 9.You'll have to create a new catalog file for each version of Vista if you want to update it in your ISO.[*]Inject install.wim back into the ISO if you committed changes to finish the process. You may also inject updates_installed_#_type.txt if you want to know which updates are contained in the ISO image. You can also use Microsoft's utility to rebuild the bootable ISO but that involves extracting ALL the files from the DVD, not just install.wim. Therefore, it's easier to use an ISO utility than Microsoft's utility.Injecting the catalog file is options as it is not used by setup. Edited April 17, 2007 by Space Surfer xXEmbalmerXx 1 Quote
Space Surfer Posted April 17, 2007 Author Posted April 17, 2007 I've revised my original instructios to make them more clear and also added the batch files as a compressed file. Quote
dulla Posted May 3, 2007 Posted May 3, 2007 Hi,This is a great article but I am having some issues. My integrate.xml file is blank:<?xml version="1.0" encoding="utf-8"?> I followed the instructions to the T but I am not sure about the update files. Some of them are .cab and some are .exe file extensions. Is there a specific format the the updates need to be in? I have also changed the tokens=5 to tokens=4 and that has not made a difference.On another note, is there a way I can download the doc located at http://firegeier.unattended-sponsor.de/en/updates.htmlThanks in advance Quote
Space Surfer Posted May 20, 2007 Author Posted May 20, 2007 (edited) Your updates have to be in the .msu format. This is stated in the guide but it's very easy to miss.When they are extracted, the .cab will be placed in the temp folder.I haven't seen a .doc file or .pdf of firegeier's guide. If you want to do it manually with SIM, you can follow his guide, but if you want to do it with scripts completely, then his guide is a bit hard to follow since some of his scripts are not necessary to execute, although he wants you to use them.Therefore, I had to come up with the above. Edited May 20, 2007 by Space Surfer Quote
muiz Posted July 26, 2007 Posted July 26, 2007 Same trick but now as a tool :http://rapidshare.com/files/45079481/VISTA...-TOOLS.rar.htmlWorks fine only the driver part i never tried.A friend of me made this, so credits go to : JanMaybe you can use it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.