Previously I discussed conceptually how to extract files from a patch, mentioning that the transforms contained within patches are stored as sub-storages and the cabinets that contain the files are stored as sub-streams. I’ve had a tool for a while that extracts the transforms and cabinets from a .msp file and wanted to share the slightly modified source for public consumption. This tool can extract transforms and binary streams from other Windows Installer file types such as .msi and .msm files, as well as other compound storage documents.
You can download the source and a release binary that programmatically does what I previously explained. This does not expand the files into the target directory structure, which is best handled by patching an administrative installation. What’s nice about extracting the cabinet file is that you get all files for all target products if the patch targets multiple products, which is common for Developer Division.
Extracting the transforms – both the patch transform and the non-administrative transform – can be handy in determine which transform transforms what data. For example, in identifying a patch applied to an administrative transform, I need to write a property to the non-administrative transform. To check this, I can extract the transforms and apply the non-administrative transform to the target product in Orca. If I simply applied the patch in Orca, I’d see both transforms applied and couldn’t be sure which transform wrote the property to help identify the patch as a client patch.