Tutorial on how to create an installer on OS X
-
wrote on 11 Jun 2017, 05:21 last edited by
Hi,
I recently managed to create an installer for Windows using the installer framework. Now I am trying to do the same on OS X but I am totally lost on what to put in the data folder. I guess the .app file I create is too little. What other files need to go in the data folder?
Is there any easily understandable tutorial out there?
-
wrote on 11 Jun 2017, 07:14 last edited by
Hi Sikarjan,
Did you find this extensive page about OSX deployment in the docs?
-
wrote on 11 Jun 2017, 15:59 last edited by Rondog 6 Nov 2017, 15:59
The steps I use work well (for me at least). Qt includes a utility called 'macdeployqt' which handles a lot of the complex stuff in building the app bundle. This is quite handy for OS X.
First step is to switch your application build to release in XCode. When you compile your program you should now have the app bundle in the release directory of your program. The size of this is usually small (< 5mb is typical) as it doesn't have all the linked libraries included.
Running 'macdeployqt' will populate the application bundle with everything it needs to contain and adjusts the relative path names of everything necessary:
cd Release macdeployqt some_application.app
The bundle size at this point should be noticably larger ( > 20 mb perhaps). Note: If you run 'macdeployqt' on an application bundle you can't do it a second time as it is already modified. It is easier to delete it and start again.
I have had problems where 'macdeployqt' doesn't do a couple of things (like move the icons file into the resource folder of the app bundle). At this point make any changes that are necessary.
Once you have the bundle the way you like it run this:
hdiutil create some_application.dmg -srcfolder some_application.app -format UDZO -volname Name_Of_Volume
This will create the distributable DMG file.
Note: You can tell 'macdeployqt' to create the DMG bundle with a command line option. I don't do this because I usually need to tweak a few things first.
-
Hi,
It is:
macdeployqt -dmg
1/6