<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi,<br>
    <br>
    I am sure we can shrink the installer more with better compression
    settings. Unfortunately I am not able to try these theory now
    because I have problem with Windows based build system. So any
    participation related to this topic is welcome <br>
    <br>
    The current situation:<br>
    We are using double compression for creating LibreOffice install kit
    for Windows:<br>
    <br>
    1) Compressed CAB file contains the installable files<br>
    2) The installation system is packed into the NSIS based
    preinstaller.<br>
    <br>
    According to <br>
        solenv/bin/modules/installer/globals.pm<br>
        solenv/bin/modules/installer/windows/msiglobal.pm<br>
        setup_native/source/win32/nsis/downloadtemplate.nsi<br>
    <br>
    For cab file compression we are using:<br>
    globals.pm<br>
        cabfilecompressionlevel = 7<br>
    <br>
    and<br>
    <br>
    msiglobal.pm<br>
        .Set CompressionType=LZX<br>
        .Set Compress=ON<br>
        .Set CompressionLevel=cabfilecompressionlevel=7<br>
    options.<br>
    <br>
    For NSIS based presintaller we are using:<br>
        SetCompressor lzma<br>
    option.<br>
    <br>
    So currently we use a high compression for cab file generation which
    produces small file but takes more time. Then recompress it with
    lzma that may not able to compress so much but takes long time.
    However we use NSIS in SetCompress auto mode that might causes
    compression test and if it is not enough good it drops the
    compressed file and use the original cab file.<br>
    <br>
    My idea is to use only one tight compressor and the other archiver
    should used in store or zip mode. So there is to way to rethink the
    compression practice:<br>
    <br>
    1) Maximize the compression of CAB files and minimalize NSIS
    compression:<br>
        This produces a smaller cab file but if the installer request
    files in non other sequence as compressed may we pay penalty in
    uncompression time. <br>
    <br>
    For this we can use CAB compression settings:<br>
        .Set CompressionType=LZX<br>
        .Set Compress=ON<br>
        .Set CompressionMemory= 21<br>
    <br>
    (We can eliminate .Set CompressionLevel=cabfilecompressionlevel=7
    maybe it is useful for MSZIP compression (or not))<br>
    <br>
    For NSIS we use simple store or small compression:<br>
    <br>
    a)<br>
        SetCompress Off<br>
        SetDatablockOptimize On<br>
    <br>
    b)<br>
        SetCompress Force<br>
        SetCompressor zlib<br>
        SetDatablockOptimize On<br>
    <br>
    OR<br>
    <br>
    2) CAB file only store the installer's files and NSIS compression
    set to high:<br>
        This may produces the smallest installer so I would try this for
    first. The compression of NSIS takes time but decompression speed is
    and also the installation is fast. The    preinstallation may takes
    dictionary equivalent memory usage so we should not set Dictionary
    size larger than 32-64 MB. The only negative effect, the
    preinstalled (unpacked) installer uses same diskspace as the fully
    installed package (For installation we need at least twice space of
    full installation).<br>
    <br>
    For this we can use CAB store setting:<br>
        .Set Compress=OFF<br>
    <br>
    For NSIS we use simple store or small compression:<br>
    <br>
    SetCompress Auto<br>
    SetCompressor /SOLID lzma<br>
    SetCompressorDictSize 64<br>
    SetDatablockOptimize On<br>
    <br>
    <br>
    References:<br>
    <br>
        <a class="moz-txt-link-freetext" href="http://msdn.microsoft.com/en-us/library/bb417343.aspx">http://msdn.microsoft.com/en-us/library/bb417343.aspx</a><br>
    <br>
       
    <a class="moz-txt-link-freetext" href="http://www.symantec.com/connect/articles/advanced-nsis-scripting-part-1">http://www.symantec.com/connect/articles/advanced-nsis-scripting-part-1</a>
    <br>
    <p>"The SetCompressorDictSize accepts one setting, which is the
      number of megabytes to use for the dictionary size. The greater
      this number, the more memory is required to execute the
      installation. The memory requirement to run the installer will be
      the dictionary size plus about 4 megabytes or so. The default
      dictionary size is 8 megabytes. You can get a slightly better
      compression ratio by changing this to 16, 32, or 64. You can set
      this up to 128 or possibly higher, but you won't notice much
      difference when you use a dictionary size greater than 64.</p>
    <p>With that in mind, I suggest that you use "SetCompressorDictSize
      64", but you can experiment with this value to see what works best
      for your particular installer."<br>
    </p>
    <p>    <a class="moz-txt-link-freetext" href="http://nsis.sourceforge.net/Docs/Chapter4.html#4.8.2.3">http://nsis.sourceforge.net/Docs/Chapter4.html#4.8.2.3</a><br>
    </p>
    What is your opinion? Can somebody test it on a real Windows build
    system? <br>
    <br>
    -- <br>
    <div class="moz-signature">
      <title>Szalai Kálmán</title>
      <pre wrap="">Best regards,

Kálmán „KAMI” Szalai | 神 | kami911 [at] gmail [dot] com


My favorite projects:

<a href="http://ooop.sf.net/">OxygenOffice Professional</a> - office suite - for everybody | <a href="http://hun.sf.net/">Magyarul</a> - In Hungarian

<a href="http://bit.ly/10ucTR">Blog</a> | <a href="http://bit.ly/eYZO6">Support</a> 

<a href="http://bit.ly/gJuJZ">Follow me</a>, if <a href="http://bit.ly/kDocB">you can</a>

</pre>
    </div>
  </body>
</html>