Windows Update - Extract an Update

ByLine
How to Extract a Windows Update
Synopsis
How to extract a Windows Update using both the manual and automatic methods.
How to Extract a Windows Update

information   Information
This tutorial will show you how to extract a Windows Update file to release the contents, using both the manual and automatic methods. You might consider doing this if you are a technical expert trying to find a replacement for a corrupt file. Extracting the contents of the update already identified to be the one containing the correct version of the file in question is often the most efficient way of sourcing this replacement.
Note   Note
This process is intended for advanced users only.
warning   Warning
It is imperative that you do not use any 3rd Party tool to extract Windows Update .cab files, such as 7-Zip or Win-Zip, as these tools incompletely extract such archives. However, due to different formatting in service packs, these tools often will extract service pack .cab files completely, but to be sure, you are better off using one of the below methods anyway.



Method One
Automatic method using KB_Extractor

warning   Warning
Please do not mirror or directly link to KB_Extractor. You may only link to this tutorial. To negotiate the use of this tool, please contact me.
Note   Note
If you are using this tool on a machine not running Windows Vista, you may need to install the .net Framework 2.0. Download details: Microsoft .NET Framework 2.0 Service Pack 2

However, this is already included in Windows Vista, and so if you are running Windows Vista, downloading this package is not required.

Download KB_Extractor version 1.2 (dated: 26/06/2011) to your Desktop. download

This tool has two modes.

To extract an update:

Simply drag the update you wish to extract onto the pre-saved executable, and wait for the extraction to complete.
Note   Note
Please be aware that large updates such as service packs can take around ten minutes to extract.
Tip   Tip
This tool should successfully extract most types of Windows Update related packages, including packages with the following file extension: .msu, .cab, .exe. Most types of packages, including standard Windows Update packages, service packs, pre-extracted .cab files, Microsoft Security Essentials installers, and Internet Explorer installers, including the extraction of packages containing sub packages, such as language packs will be extracted perfectly. However, if you find any bugs, or any updates which are incompletely extracted, please do contact me giving full details.
Once the extraction has completed, the folder containing the extracted contents will open.

To drag an update onto the executable, first select the update:
1.JPG

Then drag the update:
2.JPG

over the executable, and release:
3.JPG


During the extraction, there are three distinct phases:

Phase 1. This phase will normally only appear for large service packs:
4.JPG

Phase 2:
5.JPG

Phase 3:
6.JPG

Tip   Tip
Simply click on any of these images for an enlarged view.
Note   Note
If a package contains several sub-packages, phases 2 and 3 will loop around once for each package.


To Clean up your Temporary files:

warning   Warning
All extracted updates are extracted to sub-directories in the %TEMP% folder (commonly located in your %UserProfile%\AppData\Local\Temp folder, which would for me, as an example, be C:\Users\Richard\AppData\Local\Temp) However, particularly if you extract a lot of service packs, this folder can become very bloated in size.

To empty this, simply double click on the executable:
7.JPG

type in "y", and press ENTER or RETURN on your keyboard. Again, you can click on any screenshot to enlarge it.

8.JPG

KB_Extractor will close when it has finished emptying your temporary folder.

Note   Note
KB_Extractor will only empty the temporary folder of sub-directories in the format of those created by this tool.
Note   Note
This process can take up to ten minutes if this tool has extracted several service packs.




Method Two
Manual Method using expand.exe

warning   Warning
This method is considerably harder, and far more time consuming. However, it only uses tools included in a standard Windows installation. Also, different styles of packages may require additional extraction, but using the same techniques. Unfortunately, I cannot document every single different package style here.
NOTE: You can open a command prompt by typing cmd in the Start Menu Search box and pressing Enter.

The general formula for an update is:

expand -f:*{update name}.msu {destination folder}
expand -f:*{update name}.cab {destination folder}


and for a Service Pack:

{service pack name} /x:{destination folder}
expand -f:* {service pack name} {destination folder}


Therefore, to unpack Windows6.1-KB980302-x86.msu which is already in C:\Temp you must type these two commands:

expand -f:* C:\TEMP\Windows6.1-KB980302-x86.msu C:\TEMP
expand -f:* C:\TEMP\Windows6.1-KB980302-x86.cab C:\TEMP


and for a Service Pack, such as this Vista SP2, already in C:\TEMP:

C:\Temp\Windows6.0-KB948465-X86.exe /x:C:\Temp
expand -f:* C:\Temp\Windows6.0-KB948465-X86.cab C:\Temp



Previous Versions:

warning   Warning
Please be aware that these versions are out of date, may contain bugs, and are no longer supported.

Version 1.0 (dated: 21/02/2011): download
Version 1.1 (dated: 04/June/2011): download


That's it,
Richard


 
Last edited by a moderator:

Comments

lol. A few hours have gone past. Has anyone tried extracting a service pack and deleting the temp files at the same time yet!? The program responds pretty well, with just an outputted "Cannot be found" and closure.

Also, thanks go to Brink for the new icon!
 
All extracted updates are extracted to sub-directories in the %TEMP% folder (commonly: C:\Users\Richard\AppData\Local\Temp) However, particularly if you extract a lot of service packs, this folder can become very bloated in size.
Shouldn't the C:\Users\Richard\AppData\Local\Temp part be either:

%USERPROFILE%\AppData\Local\Temp
or
C:\Users\"Username goes here"\AppData\Local\Temp

Just to clear up the fact that not everyone will have a C:\Users\Richard folder?

Tom
 
Brilliant work Richard. Awesome !
I am sure it will be a well used Tutorial.
Look out for it at 'a thread near you soon'.
kesume.
 
All extracted updates are extracted to sub-directories in the %TEMP% folder (commonly: C:\Users\Richard\AppData\Local\Temp) However, particularly if you extract a lot of service packs, this folder can become very bloated in size.
Shouldn't the C:\Users\Richard\AppData\Local\Temp part be either:

%USERPROFILE%\AppData\Local\Temp
or
C:\Users\"Username goes here"\AppData\Local\Temp

Just to clear up the fact that not everyone will have a C:\Users\Richard folder?

Tom
lol. After all that I forgot to actually make the change! Thanks again, Tom, and corrected now!
 
Brilliant work Richard. Awesome !
I am sure it will be a well used Tutorial.
Look out for it at 'a thread near you soon'.
kesume.
Thank you very much Kesume! I am not sure that it will be well used at all - it is only really for Windows Update Error gurus, but oh well!
 
Bug Report:

A bug has been found in this software. This is not a security vulnerability, and current evidence shows that it is not exploitable, and so this tool will not be temporarily pulled.


Steps to replication:
  • Download a .msu file from the Microsoft Download Centre.
  • Rename the .msu to a name which differs from Microsoft's original name.
  • Attempt to extract this .msu using KB_Extractor.
Expected Outcome:
  • Complete extraction of the .msu file.
Actual Outcome:
  • Incomplete extraction of the .msu file.
  • The internal .cab file will not be extracted.
Workarounds:



1)
  • Retain Microsoft's original name on the .msu file prior to attempted extraction.
  • Rename the .msu file back to Microsoft's original name prior to attempted extraction.
2)
  • Perform a second, manual extraction of the internal .cab file using either KB_Extractor, or the manual method using expand.exe.
A permanent solution:
  • This bug will be fixed in version 1.1 of this tool.
  • No release date for this release has yet been set.
 
Version 1.1 is now signed off, dated 4th June 2011.

Changelog:

Code:
[B]1.0:[/B]
Initial Release

[B]1.1:[/B]
FIXED: Incomplete extraction of .cab files with only a single file in them.
FIXED: Incomplete extraction of renamed .msu files.
FIXED: Faulty logic leading to files named with specific names passing into the wrong extraction category.
ADDED: Custom error message for attempting to extract 64bit .exes on a 32bit computer.
Version 2.0 is planned, and will extract update packages in rarer formats and styles
 
Last edited:
Version 1.2 is now signed off, dated 26/06/2011.

Changelog:

Code:
[B]1.0:[/B]
Initial Release  [B]

1.1:[/B] 
FIXED: Incomplete extraction of .cab files with only a single file in them. 
FIXED: Incomplete extraction of renamed .msu files. 
FIXED: Faulty logic leading to files named with specific names passing into the wrong extraction category. 
ADDED: Custom error message for attempting to extract 64bit .exes on a 32bit computer.

[B]1.2:
[/B]FIXED: Faulty logic which caused the custom error message for attempting to extract 64bit .exes on a 32bit computer to appear more often than it should, masking other errors.
FIXED: Empty "Extracted" folders.
ADDED: Support for packages using rarer extraction arguments.
I didn't actually originally intend to release this version, but it provides a few new bug fixes and features, so in the end I did.
 
Last edited:
Top