How to extract, modify and rebuild a Cabinet File?

asquared picture asquared · Jun 4, 2014 · Viewed 14.1k times · Source

I can successfully extract Cabinet files (.cab) using the Windows tool Expand.exe.

Expand.exe foo.cab -F:*

I now want to modify some extracted files and rebuild a Cabinet file from the directory structure.

I found MakeCab.exe and CabArc.exe and tried MakeCab.exe but it doesn´t work. (There are several files with the same name in different subdirectories and MakeCab.exe doesn´t like that. But the directory structure and the files come from a Cabinet file, so it has to work somehow.)

For extraction I also tried the Linux tool cabextract, which gave me another output with less files/directories extracted. So I assume there are files in the Cabinet file which also are archived and Expand.exe extracts them too.

So how can i extract, modify and rebuild a Cabinet file?

(The Cabinet files come from WSUS / Windows Update.)

Answer

Ben H picture Ben H · Dec 9, 2014

It's not supported to modify a Windows Update (WU) CAB. The CAB files you download from WU are digitally signed by Microsoft and Windows will refuse to install them if the signature is invalidated. Additionally, without special configuration the WSUS server will also realize the CAB files have been modified and re-download fresh copies from the upstream server or MU.