1

I'm looking at removing the CAB file from a large MSI file, so that I am left with two files: A small MSI File and a large CAB File.

I've been using msidb to extract the CAB but I hit a brick wall here and cannot figure out how to reduce the size of the MSI to account for the CAB no longer being stored within it.

Any suggestions?

Rookasaur
  • 521
  • 1
  • 6
  • 22
  • It has come to my attention that after extracting the cab file using msidb -x and then removing the stream with -k. You can then open the msi in Orca and save it, this then reduces the msi size down. – Rookasaur Dec 15 '14 at 12:05
  • Not sure why you would want to do that, seeing as a regular [administrative installation](https://stackoverflow.com/questions/5564619/what-is-the-purpose-of-administrative-installation-initiated-using-msiexec-a/5751980#5751980) will get your files extracted and you get a small MSI next to the extracted files. With that said, I suppose you could open the MSI in Orca after your manual cab extraction and do a "save as" instead of "save". That might just create a new and smaller file since it is now serialized without any "gaps" in the COM-structured storage file (MSI file format). – Stein Åsmul Jul 10 '19 at 08:47

1 Answers1

1

MSI API doesn't per say have a compact database function. There's a help topic:

Reducing the Size of an .msi File that suggests:

To remove wasted storage space and reduce the final size of .msi files, you have the following options. •Export all of the tables in the database to .idt files, and then import those into a new database. This produces the most compact storage possible. •Use a software utility for compacting the storage space of OLE document files.

Assuming this is your MSI, just use your tool to build it uncompressed. If it's another MSI you'll have to follow the recommendations. You'll also need to update the Media table to tell it that you aren't using an embedded cab anymore.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100