Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum compression of a MSI install using WIX

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!

like image 917
MX4399 Avatar asked Apr 09 '10 08:04

MX4399


2 Answers

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.

like image 116
MX4399 Avatar answered Oct 31 '22 11:10

MX4399


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

like image 29
Yan Sklyarenko Avatar answered Oct 31 '22 11:10

Yan Sklyarenko