How can I reduce the size of a 1GB MSI file using Orca?

只谈情不闲聊 提交于 2021-02-05 07:42:23

问题


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.


回答1:


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




回答2:


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:

  • Media Element (CompressionLevel)
  • MediaTemplate Element (CompressionLevel)

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:

  • What is the compression method used by MSI files?
  • How to generate msi/exe installer file in visual studio 2017 for a project of over 24 GB files?


来源:https://stackoverflow.com/questions/56380485/how-can-i-reduce-the-size-of-a-1gb-msi-file-using-orca

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!