We have a setup project that produces an uncompressed MSI file and no Setup.exe at all, to be later compressed by NSIS.
In a special build setting, I want to copy that MSI before it’s being wrapped by NSIS, change the copy, and keep it. I would also like to compress it, after it has been created by the msbuild.
Is there a simple way (command line tool of some kind, maybe?) I can use to just compress an already created msi file?
We have a setup project that produces an uncompressed MSI file and no Setup.exe
Share
Yes! See the Windows SDK 🙂
There are a bunch of example scripts showing how to manipulate MSI files using the Windows Installer API.
An MSI file itself is never actually compressed, however it can contain embedded CAB files which may be compressed.
I would suggest putting together some script that extracts any embedded CAB files from the MSI, uncompresses them one at a time to a temporary folder, re-compresses using better compression, then replaces the non-compressed CAB inside the MSI with the newly compressed one.
Any tool you can find will do exactly what I’ve mentioned above, however putting it together yourself should provide a deeper understanding of how MSI works 🙂