PDA

View Full Version : Huge Mac .dmg files, can anything be done to make them smaller?



colin207
9th February 2011, 22:11
Hi - My Qt app, which uses shared libs (gui, core, network and webkit) ends up as a 17mb installer on Windows (comprising my app binary plus the Qt dlls and image plugins), built with VC2010.

I now do a Mac version. Using the standard Qt 4.7.1 distribution (for cocoa) on my Mac (Mac OSX 10.6.6) with Xcode 3.2.5 (ie using the prebuilt Qt from nokia, not one built by me). I build the app in totally standard way (qmake, then build in Xcode). I then use macdeployqt with -dmg option and get a .dmg file. Thats all fine and it works.

But the dmg file is 44 mb big, ie almost 3 times bigger on Mac than the same program for Windows.

Any ideas how to make for a smaller binary distribution on Mac?

Thanks.

PS I am definitely building in release mode.

wysota
9th February 2011, 23:29
Make sure all the libs are stripped. And remember you are building for a 64bit system which has bigger words, you install will always be larger than for a 32bit system.

colin207
10th February 2011, 07:01
But how do I struip them? And where are they? I'm using the pre-built qt from nokia; I didnt compile it. I would have thought their release libs would already have been stripped. Thanks.

cgorac
10th February 2011, 08:06
Had exactly the same problem - most of the size in Mac installer comes from having both 32-bit and 64-bit versions of Qt libraries (and your executable probably) bundled together in individual files (in Mac lingo, this is called "universal binaries"). You could check this by yourself, for example through running "file" in terminal on libraries and executable in your installation directory. For this reason, I wish that Trolltech guys change this, and split 32-bit and 64-bit versions, but that probably won't happen, so your only choice at the moment is to compile Qt by yourself: I did that, and am delivering 32-bit version only of libraries and the executable in my Mac installer, and the size of installer is alike to Windows installer (still somewhat larger, but acceptable).