Here is how to create .dmg file from source code so that the Free Software can easily be distributed to be used by any level of users. Creating .dmg itself is quite easier, but what basically most wants – to create a distributable software package to avoid building from command line, we can give example with Lime Text – Free Alternative to Sublime Text, is only available as source code in Github. We can not expect that all the users will be able to use command line to install and use the softwares. You have to consider two steps :
- Installing dependencies on the target computer, for all applications, not just yours : then you need to go for the .pkg route (to be later delivered as .dmg).
- Embedding dependencies in your application bundle, so that you can provide, the .dmg with your app to be dragged to any folder.
Create .dmg File From Source Code : The Old Way
Old way was to install or build the software first and then to create the .dmg file using some other or default utilities, descriptions are available all over the Internet, like written in details here :
There are paid and free third party tools which basically use this way :
The basic problems of this method are – with Retina display there will be problem with icon if created on Retina Mac and for continuous development of hundreds of different version of one Application, the developer need to install each and every very of the application and PowerPC Macs, Macs with OS X 10.4 will not be able to execute the resulting stuff.
Create .dmg File From Source Code : Newer Way Using node.js App
We found node-dmg to be quite effective tool :
Although the steps looks scary to many users due to the need to supply data in JSON format, it actually avoid the need of code signing.