1

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>

Edit:

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

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

msm opened with 7z

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

msi opened with 7z

Edit 2:

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>

This is a VisualStudio 2012 project - Release - x64.

Finally...

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

Ymir
  • 300
  • 3
  • 11
  • Is this your own merge module? If so you should use [**Wix include files**](http://stackoverflow.com/questions/24834951/msi-reference-counting-two-products-install-the-same-msis) and not merge modules. – Stein Åsmul Sep 05 '14 at 14:28
  • No, it's a third part module. – Ymir Sep 05 '14 at 14:30
  • Run an admin image of the compiled MSI to see what has been compiled into it: `msiexec /a File.msi`. – Stein Åsmul Sep 05 '14 at 14:31
  • Using includes/fragments over merge modules is a personal opinion and not universally applicable. There are pro's and con's to each. – Christopher Painter Sep 05 '14 at 16:25

2 Answers2

1

So when you set compression to high the MSI is 100MB or about the same size as the .MSM? So what's the problem here?

The merge process extracts the files from the MSI and places them into the MSI. If the MSM had a higher compression setting then the MSI you could expect the package to expand in size.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Very sorry for my typo. At high compression the MSI is 180MB. I agree there was no problem in that case. – Ymir Sep 08 '14 at 06:41
1

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

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

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

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:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164