Maximum compression of a MSI install using WIX

[亡魂溺海] 提交于 2019-12-10 04:10:10

问题


I used to build installs for an app with NSIS and the final self extractor was 1.2 MB. Now I need to use WIX due to operational needs and the same install comes out at 4.2 MB. I set the compressed flags as the docs and specs indicated on the package node. Using 7z to zip the MSI results in a 2.4 MB zip file.

Question: How can I do a maximum compress on the MSI or create a small MSI (e.g. remove unneeded resources etc) ?

Note - size is uber important and I have to use MSI/WIX now - this is a show stopper!


回答1:


The problem was an ICON element that referenced a sourcefile - the main exe - and then included the exe again, this time without compressing as a resource.

                <Directory Id="app" Name="MyApp">

                <Component Id="app.exe" DiskId="1" Guid="AGUID_123">

                    <File Id="app.exe" Name="app.exe" Source="..\app\app.exe" KeyPath="yes">
                        <Shortcut Id="ExeShortcut" Directory="ProgramMenuDir" Name="MyApp" Advertise="yes" Icon="StartMenuIcon.exe" IconIndex="0" />
                    </File>...

And lower down:

<Icon Id="StartMenuIcon.exe" SourceFile="..\app\app.exe" />

I found it using 7Zip to open the resulting MSI file and saw a familiar file size - the uncompressed main exe.

Resulting MSI file now 1.4 MB and on par with NSIS.




回答2:


Did you try to set CompressionLevel='high' attribute in Media element? Also, I should say that WiX includes only those things you instruct it to include, hence, I don't think you can easily find anything to drop out of your package...



来源:https://stackoverflow.com/questions/2605953/maximum-compression-of-a-msi-install-using-wix

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