DMG Using¶
General rules for using DMG
Available from version CQtDeployer 1.7
How to use dmg option¶
Just add to cqtdeployer option "dmg".
For example:¶
cqtdeployer ... dmg
Where: * ... - is list of other options. * dmg - option for use DMG packages.
By default, cqtdeployer will create one DMG package. If you want create multi package distribution, you should use Controll of packages options To create a new package, use the -targetPackage [package; tar1] option
cqtdeployer create DMG package for each packages.
Where:
- package - it is package name
- tar1 - it is name of the target that should be included in this package.
Or you can describe packages in configuration file
{
"targetPackage": [
[
"package",
"tar1"
],
],
"dmg": true
}
Name of the output file¶
By default, cqtdeployer creates the DMG with the name <name>.dmg in the
target dir (<targetDir>/<name>.dmg), where <name> is the name of the
package. You can change the name of the output file with the dmgOut
option:
cqtdeployer ... dmg -dmgOut MyName.dmg
For the multi packages distributions use the
-dmgOut package;nameOfOutputDmgFile syntax (the same way as the
zipOut and the debOut options).
How the DMG package is created¶
The DMG package is the DMG (the Disk Image of the macOS) of the deployed package:
└── <name> (the root of the DMG volume)
├── <name>/ - the deployed files of the package (the ready-to-use application)
├── <name>.png - the icon of the application
├── README - the name, the description, the version, the publisher and the homepage of the package
├── LICENSE - the license file of the -license option (issue #456, the original file name is kept)
└── Applications - the symbolic link to the /Applications folder (the standard drag-to-install UX)
The DMG is created with the hdiutil tool of the macOS system
(the same way the deb backend uses the dpkg-deb tool of the Linux
system):
hdiutil create -volname <name> -srcfolder <root> -ov -format UDBZ -o <targetDir>/<name>.dmg
Where:
*
How to use the created DMG¶
- Open the DMG file (double click on it in the Finder).
- Drag the
<name>folder into the Applications folder (the Applications folder is available as a symbolic link in the DMG window). - Launch the application from the Applications folder (the run script of the package starts the application with the right environment, see the macOS documentation).
License¶
The -license option (issue #456) inserts the license file into the DMG
packages. The license file is copied into the root folder of the DMG
volume, next to the application folder, the icon, the README file and
the Applications symbolic link (the standard way the macOS DMG files ship
the license / the "Read Me" text of the package). The original file name
of the license file is kept.
For example:¶
cqtdeployer ... dmg -license ./LICENSE.txt
Where:
- ... - is list of other options.
- dmg - option for create the DMG package.
- -license ./LICENSE.txt - the license file that is inserted into the DMG package.
When the user opens the DMG file the license is available in the root folder of the volume (the file of the DMG window, next to the application folder and the README file).
Limitations¶
- The dmg option is available only on the macOS host platforms: the
DMG packages are created with the
hdiutiltool of the macOS system. On the other host platforms the option is skipped with a warning (the same rule as thedeband theappimageoptions). - The dmg option was an alias for the
qtifwoption before CQtDeployer 1.7 (issue #884): the binarycreator of the Qt Installer Framework created the installer (the ".app" bundle of the macOS hosts). Now the dmg option creates the real DMG packages with the hdiutil tool (issue #899), the qtifw option is unchanged.