0

I search the web and have the impression that msi installer doesn't compress well.

So I want to know why strawberry perl's msi installer much smaller than the zip version.

ntysdd
  • 1,206
  • 2
  • 9
  • 19
  • Smaller than..? Anyway, [MSI *does* support compression](http://stackoverflow.com/questions/4208195/what-is-the-compression-method-used-by-msi-files); the amount of compression will naturally depend on what is being compressed. – user2864740 Jun 15 '14 at 05:53
  • 3
    Why are people downvoting this? It's a good question that leads to a better understanding of Windows Installer. – Christopher Painter Jun 16 '14 at 13:13

1 Answers1

2

The answer is due to Windows Installer XML Smart Cabbing. Take a look at the MSI in ORCA. Look at the file table and sort by FileSize. You'll notice there are a bunch of file names that are slightly different and yet the same size. If you extract or install the MSI or ZIP and use a difference tool you'll see they are binary identical. WiX is smart enough to create checksums of all the files in the installer and normalize them when creating the CAB. Zip does not do this. Instead each EXE gets minimal compression due to it's binary data and as a result it's not as efficient as MSI despite the fact that MSI compression is not as good as ZIP.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Here is some additional, technical information: http://stackoverflow.com/a/6313772/129130 – Stein Åsmul Jun 16 '14 at 13:50
  • So MSI will only keep one copy of binary identical files. But why can't ZIP benefit from the same redundancy? I thought a good compression should make use of these. – ntysdd Jun 28 '14 at 10:10
  • No, WiX will only place one copy of binary identical files into the MSI. Author tools such as InstallShield will happily place the same file into the MSI over and over. I'm not an expert in the ZIP specifications or the many implementations of zip/unzip but my guess is they never thought to do it. Seems RAR5 can do it: http://superuser.com/questions/406118/does-winrar-detect-duplicate-files – Christopher Painter Jun 28 '14 at 13:01