Many macOS applications come in DMG format, which is perfectly fine until you need to deploy one of these applications using your enterprise MDM solution. Most MDMs only work with PKG files so you must convert the application from DMG to PKG before you deploy it. This post will provide two simple methods I learned while doing my research on how to achieve precisely the desired task.
Access to a macOS device where you can convert and sign the PKG file. DMG File that needs to be converted; Apple Developer account; Step 1: Install or Extract the DMG file. The first step is to double click on the DMG file and extract the.App to Applications folder.
Apple Disk Image (.dmg, .smi, .img) is a disk image format commonly used by the macOS operating system. When opened, an Apple Disk Image is mounted as a volume within the Macintosh Finder.
A PKG file is a package of compressed installer files used to install a software program. It is commonly used for installing software in Mac OS X and may be installed individually or referenced by an installer script included with the software.
First Method
- Go to the folder that contains the DMG file.
- Double click the dmg file and it gets mounted as a virtual disk and reveal its contents.
- Copy the .app file to the Applications folder in the mac
- Eject the DMG file by clicking on eject button.
- Open Terminal.
- Build the PKG file using the productbuild command (might ask for your password and takes few second to finish running)
Parameters Explained
- component The path to the .app file that will be used during PKG generation.
- path_to_savedpackage/packagename.pkg The destination path for the generated PKG file and desired name.
Second Method
- Go to the folder that contains the DMG file.
- Double click the dmg file and it gets mounted as a virtual disk and reveal its contents.
- Open Terminal
- Build a PKG with the contents of the mounted dmg as a payload using the following command:
Parameters Explained
- /Volumes/DMGName The full path to the mounted DMG file.
- version The application version, make sure to sync this with the version you are trying to deploy (if it’s Zoom 5.6, then this parameter is 5.6).
- identifier The app identifier, if you don’t know the value, follow this guide (The Bundle ID is what you are looking for) to get it.
- install-location The location where the PKG will be installed, leave it as it is.
- Sample-1.0.pkg The full path and name of the PKG file that will be generated, adjust it as needed.
References
What is DMG file
A DMG File stands for Disk Image file and it is a file format which is used to create mountable disks on the Macintosh operating system. The DMG File format contains data in the form of blocks which are often secured using encryption methods or are compressed using compression algorithms. DMG files are used for installing tools and softwares into the Mac OS operating system. The file is downloaded from the internet from the software manufacturer’s website and upon mounting the DMG file, a virtual disk is generated from where the user can either copy the application to the applications folder or run an installation script depending on the type of installation.
The newer disk image file was used in place of the original IMG or image file which was used in earlier versions of mac that are classic mac operating systems. Disk Image Files are only meant to be used in Mac based systems and not on the Windows operating systems. However, using some image softwares like Daemon tools on windows, we can mount disk images of DMG type on windows too. Some tools can also convert DMG Files to windows-recognizable image files like .ISO files.
Benefits of DMG Disk Image format
- DMG Images are read only which ensures that the files inside the installer are not altered with. This makes the software supplied inside the dmg secure from viruses as no one can alter the file after it is created.
- Instead of sending more than one file over the internet, the creators have to send a single dmg disk image which contains all the required installation files of the software that can be simply dragged and dropped into the applications folder of Mac to install them.
- DMG files can be customized according to the manufacturer’s wish so that the installers look pleasing when people download the files for installing software.
- Disk images can be mounted on a computer just like a physical cd. This is a good thing as people can save a copy of the DMG file as a backup which can be used later to restore the previous state of the files.
What is ISO File
An ISO file stands for International Organization for Standardization file format which specified ISO as the standard file format for disk image files in Windows. It is a file which can be used to mount disk image files in Windows operating systems. It can be used to emulate a CD, DVD or any other disk drive in Windows virtually.
It is generally used to hold disk images of operating systems like linux which can be burned into a disk or a USB drive. It is also used to send installation files of Windows softwares through the internet but they are usually sent through a binary package with an executable or an msi installer.
Basically ISO files are an image of something so you could have an image of a computer software package that would be all the files that existed on that computer software in one finite image. You can also burn that image file to a CD because these are optical images.
How to Convert DMG File to ISO
Pkg To Iso
The ISO file format can be used on the Macintosh operating systems, however, almost all of the software packages for Mac is downloaded from the internet as a DMG Disk Image file. Although the DMG file format has some features which are not available in the ISO format like file encryption methods and compression algorithms, DMG files cannot be used anywhere else instead of a Mac. This is why we may need to convert DMG FIles to the ISO File format.
To convert dmg to iso file on Windows, you should install third party softwares like PowerISO. It is a disk image burning software that can be used to convert DMG File to ISO on Windows. You can also directly burn DMG Files to a CD/DVD using this software.
Before downloading PowerISO, check the system requirements that is required to install and run Power ISO.
System Requirements
- Any one of the following Windows Operating systems: Windows 98 / Windows Me/ Windows NT 4.0 / Windows 2000 / Windows XP / Windows 2003 / Windows Vista / Window 7 / Windows 8 / Windows 10 operating system or above.
- PowerISO can be used in both 32-bit and 64-bit versions of windows.
- Processor: Intel Pentium with 166 MHz clock speed or better.
- 64 Megabytes of RAM.
- A minimum of 128 Gigabytes of storage space is required to install and run PowerISO.
Steps to download PowerISO on Windows
Create Pkg File
- Visit the official website of the PowerISO.
- Go to the download section of the website
- Select the version 32 bit / 64 bit according to your computer.
- Click on download PowerISO 64 /32 bit
Now, an installer file will be downloaded on your computer, open the file and do the required steps to install PowerISO on your computer.
To convert DMG to ISO, first open the PowerISO application on Windows and then select the tools option from the top ribbon.
From the dropdown list, select the option labeled as convert. Now you will see a dialog box titled convert image file. You can use this to convert image files from one file format to another. In our case, we have to convert it from dmg file format to iso file format so we will set it up accordingly.
Convert Dmg To Pkg Jamf
Now, we have to select a source image which will be your dmg file you want to convert. After that, select the destination image file and name it as the name of the iso file you want at the end. Below that, there is a drop down menu where you have to select the output file format, select iso file format there.
Convert Dmg To Pkg Online
After that, there are image file settings options where you can password protect the images but since we are converting dmg file to iso, iso doesn’t have password protection options so that section is greyed out.
Convert Pkg To Dmg
Now, select OK to start the conversion process. Wait for a few minutes for the conversion to complete. When the conversion is complete, you should get a message which says “Converting image file completes successfully”. If there is an error, check whether the input dmg file is corrupted or not. If there are no errors, go to the location of the output file you specified earlier, you should have an iso output file of the name you have given.