使用 WIX 最大程度地压缩 MSI 安装

发布于 2024-08-28 02:00:57 字数 235 浏览 2 评论 0原文

我曾经使用 NSIS 为应用程序构建安装,最终的自解压程序大小为 1.2 MB。现在,由于操作需要,我需要使用 WIX,相同的安装结果为 4.2 MB。我将压缩标志设置为包节点上指示的文档和规格。使用 7z 压缩 MSI 会生成 2.4 MB 的 zip 文件。

问题:如何对 MSI 进行最大压缩或创建小型 MSI(例如删除不需要的资源等)?

注意 - 大小非常重要,我现在必须使用 MSI/WIX - 这是一个表演障碍!

I used to build installs for an app with NSIS and the final self extractor was 1.2 MB. Now I need to use WIX due to operational needs and the same install comes out at 4.2 MB. I set the compressed flags as the docs and specs indicated on the package node. Using 7z to zip the MSI results in a 2.4 MB zip file.

Question: How can I do a maximum compress on the MSI or create a small MSI (e.g. remove unneeded resources etc) ?

Note - size is uber important and I have to use MSI/WIX now - this is a show stopper!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

無心 2024-09-04 02:00:57

问题在于 ICON 元素引用了源文件(主 exe),然后再次包含该 exe,这次没有作为资源进行压缩。

                <Directory Id="app" Name="MyApp">

                <Component Id="app.exe" DiskId="1" Guid="AGUID_123">

                    <File Id="app.exe" Name="app.exe" Source="..\app\app.exe" KeyPath="yes">
                        <Shortcut Id="ExeShortcut" Directory="ProgramMenuDir" Name="MyApp" Advertise="yes" Icon="StartMenuIcon.exe" IconIndex="0" />
                    </File>...

下面:

<Icon Id="StartMenuIcon.exe" SourceFile="..\app\app.exe" />

我发现它使用 7Zip 打开生成的 MSI 文件,并看到熟悉的文件大小 - 未压缩的主 exe。

生成的 MSI 文件现在为 1.4 MB,与 NSIS 相当。

The problem was an ICON element that referenced a sourcefile - the main exe - and then included the exe again, this time without compressing as a resource.

                <Directory Id="app" Name="MyApp">

                <Component Id="app.exe" DiskId="1" Guid="AGUID_123">

                    <File Id="app.exe" Name="app.exe" Source="..\app\app.exe" KeyPath="yes">
                        <Shortcut Id="ExeShortcut" Directory="ProgramMenuDir" Name="MyApp" Advertise="yes" Icon="StartMenuIcon.exe" IconIndex="0" />
                    </File>...

And lower down:

<Icon Id="StartMenuIcon.exe" SourceFile="..\app\app.exe" />

I found it using 7Zip to open the resulting MSI file and saw a familiar file size - the uncompressed main exe.

Resulting MSI file now 1.4 MB and on par with NSIS.

无风消散 2024-09-04 02:00:57

您是否尝试在 Media 元素中设置 CompressionLevel='high' 属性?另外,我应该说 WiX 仅包含您指示它包含的内容,因此,我认为您无法轻松地从包中找到任何内容......

Did you try to set CompressionLevel='high' attribute in Media element? Also, I should say that WiX includes only those things you instruct it to include, hence, I don't think you can easily find anything to drop out of your package...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文