Compress uncompressed MSI file
We have a setup project that creates an uncompressed MSI file and no Setup.exe at all, which will later be compressed by NSIS.
In a custom build setup, I want to copy this MSI before it gets finished by NSIS, modify it and save. I would also like to compress it after msbuild has been created.
Is there an easy way (maybe a command line tool)? Can I use to compress an already created msi file?
a source to share
Yes! See Windows SDK :)
There are several sample scripts showing how to manage MSI files using the Windows Installer API.
The MSI file itself is never compressed, however it may contain embedded CAB files that can be compressed.
I would suggest building some script that will extract any embedded CAB files from the MSI, unzip them one at a time into a temporary folder, recompress using better compression, and then replace the uncompressed CAB inside the MSI with the newly compressed one.
Any tool you can find will do exactly what I mentioned above, however sharing it should provide a deeper understanding of how MSI works :)
a source to share
Convert MSI from uncompressed to compressed.
- Perform an administrative installation of msi.
- Use PATCH to transfer the patch files you want on it.
- Copy the files WiFilVer.vbs and WiMakeCab.vbs from
"C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\sysmgmt\msi\scripts"
to the administrator installation folder. - To update files with new ones, run:
CScript //nologo WiFilVer.vbs vendormsi.msi /U
- To create a cab file and insert it into msi:
cscript /nologo WiMakCab.vbs eTalk.msi Data1 /R /L /C /U /E /S
- If you don't get the cockpit file from step 5, check your Media table in Orca and see: " http://www.spinnersoftware.com/kb/en/msi/createmsi.html " find the compression section.
- You should now have an msi that includes everything.
Compress MSI with internal or external cab file
- Perform an administrative installation of msi.
- Use PATCH to transfer the patch files you want on it.
- Copy the WiMakeCab.vbs file from the Windows SDK to the administrator installation folder.
- Launch: cscript WiMakCab.vbs Vendor.msi Data1 / L / C / U / E
- You must have an MSI with a cab file embedded.
a source to share