Compressing an uncompressed MSI file

╄→尐↘猪︶ㄣ 提交于 2019-12-01 12:19:09

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 :)

Marlon

Converting MSI from uncompressed to compressed.

  1. Do an admin installation of the msi.
  2. Use PATCH to pass the patch files you want on it.
  3. Copy WiFilVer.vbs and WiMakeCab.vbs files from "C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\sysmgmt\msi\scripts" to the admin install folder.
  4. To update the files with the new ones run: CScript //nologo WiFilVer.vbs vendormsi.msi /U
  5. To create cab file and embed it into the msi: cscript /nologo WiMakCab.vbs eTalk.msi Data1 /R /L /C /U /E /S
  6. If you don’t get a cab file from step 5 check your Media table in Orca and take a look at: "http://www.spinnersoftware.com/kb/en/msi/createmsi.html" look for the section on compressing.
  7. You should now have an msi which includes everything.

Compressing an MSI with an internal or external cab file

  1. Do an admin installation of the msi.
  2. Use PATCH to pass the patch files you want on it.
  3. Copy the WiMakeCab.vbs file from the Windows SDK to the admin install folder.
  4. Run: cscript WiMakCab.vbs Vendor.msi Data1 /L /C /U /E
  5. You should have an MSI with embedded cab file.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!