压缩未压缩的MSI文件 [英] Compressing an uncompressed MSI file

查看:97
本文介绍了压缩未压缩的MSI文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个安装项目,该项目将生成未压缩的MSI文件,根本不会生成Setup.exe,以后将由NSIS进行压缩.
在一个特殊的生成设置中,我想在NSI包装该MSI之前复制该MSI,更改该副本并保留它.我还想在msbuild创建它之后对其进行压缩.
有没有一种简单的方法(也许是某种命令行工具?)可以用来压缩已经创建的msi文件?

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?

推荐答案

是的!请参见 Windows SDK :)

有一堆示例脚本,展示了如何使用Windows Installer API处理MSI文件.

There are a bunch of example scripts showing how to manipulate MSI files using the Windows Installer API.

一个MSI文件本身从来没有真正被压缩过,但是它可以包含可能被压缩的嵌入式CAB文件.

An MSI file itself is never actually compressed, however it can contain embedded CAB files which may be compressed.

我建议组合一些脚本,以从MSI提取所有嵌入的CAB文件,一次将其解压缩到一个临时文件夹,使用更好的压缩率重新压缩,然后用MSI替换MSI内部未压缩的CAB.新压缩的一个.

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.

您可以找到的任何工具都可以完成我上面提到的事情,但是将其放在一起应该可以更深入地了解MSI的工作原理:)

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

这篇关于压缩未压缩的MSI文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆