MSI比MSM大两倍 [英] Msi two times larger than msm

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

问题描述

我的.msm为100MB,构建WiX项目时,我的.msi为200MB 这里是一些代码:

I have a .msm of 100MB and when I build my WiX project I get a .msi of 200MB Here some code:

<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"  />

<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />

<Directory Id="TARGETDIR" Name="SourceDir">
  <Merge Id="MyMsmFile" Language="1033" SourceFile="msm\MyMsmFile.msm" 
         DiskId="1" FileCompression="yes" />
  <Directory Id="INSTALLFOLDER" Name="Foo" >
  </Directory>
</Directory>

<Feature Id="Foo_client" Title="Foo Client" Level="1" 
         ConfigurableDirectory="INSTALLFOLDER" >
  <Feature Id="Server" Title="Foo Server" Level="32767">
    <MergeRef Id="MyMsmFile"  />
  </Feature>
</Feature>

请注意,< Media>处的CompressionLevel ="high"将.msi从200MB提升到180MB

Please note that the CompressionLevel="high" at <Media> takes the .msi from 200MB to 180MB

这就像我看到带7z的.msm的内容(看起来像带有!前缀的orca表以及一个名为MergeModule.CABinet的文件一样).

This is like I see the content of .msm with 7z(Looks like orca tables with ! prefix and a file called MergeModule.CABinet and others).

这就像我看到7z(文件名)的.msi内容一样.

This is like I see the content of .msi with 7z (The filenames).

好像我把msm包括了两次.如果我设置EmbedCab ="no",则我的msi仍然超过100MB,再加上100MB的product.cab.

It looks like I'm including the msm 2 times. If I set EmbedCab="no" my msi is still over 100MB plus a 100MB of product.cab.

请查看以下修改后的代码:

Please take a look at this revised code:

  <Product Id="PUT-GUID-HERE"
       Name="MyProduct"
       Language="1033"
       Version="0.0.1"
       Manufacturer="MyCompany"
       UpgradeCode="PUT-GUID-HERE">

    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    <Media Id="1" Cabinet="product.cab" EmbedCab="no" CompressionLevel="high"  />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

    <UIRef Id="WixUI_FeatureTree" />

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="INSTALLFOLDER" Name="MyProduct" >
        <Merge Id="ThirdPartModule" Language="1033" SourceFile="ThirdPartModule.msm" DiskId="1" />
      </Directory>
    </Directory>

    <Feature Id="Server" Title="MyProduct Server" Level="1" >
      <MergeRef Id="ThirdPartModule"  />
    </Feature>
  </Product>

这是VisualStudio 2012项目-版本-x64.

This is a VisualStudio 2012 project - Release - x64.

最后...

我选择了一个Burn Bootstrapper项目,对不起:D

I chose to go with a burn bootstrapper project, sorry for the mess :D

推荐答案

如Chris所说,您可以尝试启用高压缩,如下所示:

As Chris says, you can try to enable high compression as illustrated here:

<Media Id="1" Cabinet="product.cab" CompressionLevel="high" EmbedCab="yes" />

有关详细信息,请阅读媒体元素文档.据我所知,高"压缩设置启用了 LZX 而不是 mszip 格式.

Read the media element documentation for more information. The "high" compression setting enables LZX instead of mszip format as far as I know.

此处是有关可用于MSI的各种压缩级别的信息的帖子:

Here is a post with info on the various compression levels available for the MSI: What is the compression method used by MSI files?

某些链接 :

Some Links:

  • What is the compression method used by MSI files?
  • http://wixtoolset.org/documentation/manual/v3/xsd/wix/media.html

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

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