Add MSU extractor

If you do patch test/analysis/diffing, you might find this tool
handy. This tool will automatically extract all the *.msu files,
and then you can search for the patched files you're looking for
quickly.

The workflow would be something like this:

1. You download the patches from:
   http://mybulletins.technet.microsoft.com/BulletinPages/Dashboard

2. You put all the *.msu files in one directory.

3. Run this tool: extract_msu.bat [path to *.msu files]

4. The tool should extract the updates. After it's done, you can
   use Windows to search for the file(s) you're looking for.
bug/bundler_fix
wchen-r7 2015-09-09 21:34:07 -05:00
parent ec3aecbc9d
commit ab1d61d80b
1 changed files with 30 additions and 0 deletions

30
tools/extract_msu.bat Normal file
View File

@ -0,0 +1,30 @@
@echo off
@setlocal EnableDelayedExpansion
@set arg=%~1
if [%arg%] == [] (
echo Argument Missing:
echo You must provide a directory that contains
echo all the Windows patches in *.msu format.
echo To Download patches manually, please go:
echo http://mybulletins.technet.microsoft.com/BulletinPages/Dashboard
exit /B
)
for /f %%f in ('dir /B %arg%') DO (
@set fname=%%f
@set lastfourchars=!fname:~-4,4!
if "!lastfourchars!" == ".msu" (
@set newname=!fname:~0,-4!
7za e !fname! -o!newname!
mkdir !newname!\extracted
expand /F:* !newname!\!newname!.cab !newname!\extracted
)
)
echo Done!
echo Now go to %arg%,
echo and then use the search feature from Windows to
echo find the files you're interested in.