1

I have written a C# WPF application. I have now created an MSI that will install the application. However, the file size is gigantic. The application contains many video and image files, which have combined to make the MSI a whopping 1GB in size.

I have tried to reduce the file size with Orca. I have used "Save As" to create a brand new MSI and have also exported the database tables and then imported them to another MSI. In both cases, the file size is reduced to less than 1MB, but then the installer doesn't work at all. Looks like it's not compressing the content, but rather removing it entirely.

How can I use Orca to reduce the MSI file size without stopping the installation from actually working? If there's another way to do it, I'm open to any suggestions.

Ben
  • 31
  • 7
  • Well, if your MSI contains files it can only be reduced by getting rid of these files. Videos and pictures are usually already compressed so MSI compression will not reduce their size. You could only extract cabinet archive(s) from the MSI file and put it near. – montonero May 30 '19 at 14:48
  • What makes you think Orca can help you dealing with image and video sizes? At least that's how i understand your question... Try to make the size of your images and videos smaller... use stronger compression for them (which could perhaps also mean different image/video file formats/codecs) –  May 30 '19 at 14:48
  • @elgonzo Orca is the only MSI editing tool I am familiar with and I've heard that it CAN be used to reduce MSI sizes, but I haven't been able to find much information explaining this further. But like I said in the question, I'm open to suggestions if there's another way to do it. Orca's not the only thing I'm willing to use. – Ben May 30 '19 at 14:52
  • I know it sounds silly but would it help to have the msi file smaller and an additional .cab file with the load in it? I don't really understand what you are trying to accomplish.. you deliver big files.. you get a big installer. – Señor CMasMas May 30 '19 at 15:32

2 Answers2

0

Online: Can you put some videos online? Youtube? Easier to manage and update over time as well. And easier access for people who do not have your product downloaded? Better for marketing? It depends if the content is help material or the actual product you are trying to sell. You can install low-res versions of the videos and images as a fallback mechanism if Internet is not available? Maybe see this older answer?

Compression: You are using WiX? No? On selecting an MSI tool. If you are using WiX, then you can try to use the highest compression level for the MSI? (MSI compression levels). This means you have to rebuild it with the new setting. There are alternative elements to do so:

WiX: In WiX it is easy to set the compression level:

<MediaTemplate EmbedCab="yes" CompressionLevel="high" />

A little crash course in minimal WiX markup to compile an MSI can be found here: Transparent aluminum! The markup towards the bottom with inline comments is usually enough for people to get going. See other resources here: installdude.com (my own experimental site - expand help section in left navigation pane). Also check "WiX Samples" in quick search section towards top.

I forgot the WiX quick-start tips answer.


Links:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • I would highly recommend *against* using `EmbedCab='yes'`, especially in this case. The cabinet in the MSI will get cached with the MSI (for uninstall purposes) and take up space on the user's system drive. Embedded cabs for a large application like this is especially painful for users. – Rob Mensching May 30 '19 at 15:43
  • That can be dealt with by using [administrative images](https://stackoverflow.com/questions/5564619/what-is-the-purpose-of-administrative-installation-initiated-using-msiexec-a/5751980#5751980)? Essentially a glorified file-extraction from the MSI making a network installation image. And [here is a piece on the huge, cached files and administrative images as well as various space saving methods](https://serverfault.com/questions/642177/how-can-i-eliminate-the-huge-cached-msi-files-in-c-windows-installer). – Stein Åsmul May 30 '19 at 15:45
  • Technically speaking it is possible for the user to create an admin image of the MSI on their computer, and installing the MSI from that image. But that will require a pretty technical user. Essentially it pushes the problem on to the user, which seems wrong to me. – Rob Mensching May 30 '19 at 15:50
0

First, build your installation package with the cabs external (not embedded) in your MSI. That will show you how large the MSI is in relation to the rest of your installation. Chances are you'll find the MSI size is insignificant compared to the content in the cabinet files. My guess is that the video and images are not compressing well in the cabinets.

If my hypothesis is correct, then your goal is to find the optimal compression for the files in the cabinets.

Note: If you use the WiX Toolset to build your MSI, we already do the tricks to ensure the MSI portion is as small as possible. You are not likely to find significant optimizations on top (and if you do, let us know at wix-devs@lists.wixtoolset.org, we'd love to improve :).

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130
  • I haven't checked what the default compression level of WiX projects are? Is it "high" outright? I'll do a quick test myself I think - unless you know off the top of your head? – Stein Åsmul May 30 '19 at 15:49
  • IIRC, it is `mszip` which was a reasonable balance back in the day. But that's based on memory. There have been optimizations made since then so I could be completely wrong now... especially for `MediaTemplate` (which is quite new). – Rob Mensching May 30 '19 at 15:51
  • If anyone is wrong about MSI.. even this many years later.. it's probably not you @RobMensching :) – Señor CMasMas May 30 '19 at 15:54
  • Quick testing showed that `` compressed more than when there was nothing defined for `CompressionLevel`. In other words I guess `high` enables [LZX compression](https://stackoverflow.com/a/6313772/129130). Unsure of side-effects? – Stein Åsmul May 30 '19 at 16:10