Tech Community Live: Microsoft Intune
Mar 20 2024, 07:30 AM - 11:30 AM (PDT)
Microsoft Tech Community
How to deploy DMG or APP-format apps to Intune-managed Macs
Published Jul 07 2020 08:43 AM 60.4K Views

By: Arnab Biswas | Product Manager - Microsoft Intune

 

Updated 10/26/22: Refresh content in line with recent updates to Intune. The scenario described in this document is no longer supported, as discussed in What’s new in Microsoft Intune. We now support direct uploading of .pkg app types into Intune. Refer to How to add macOS line-of-business (LOB) to Microsoft Intune for more information about uploading .pkg app types.

 

Updated 03/08/22: You can now upload and deploy DMG-type applications to managed macOS devices from Microsoft Endpoint Manager using the required assignment type. DMG is the file extension for Apple disk image files. For more information, see Add a macOS DMG app to Microsoft Intune.


You can use Microsoft Intune to deploy the most common app types supported by macOS such as .pkg, .dmg, or .app. Natively, Mac MDM only supports installing signed .pkg-type applications. Therefore, apps that are of non-pkg types requires admins to run commands on macOS either manually or as a script that can be distributed using Intune. The rest of the document outlines the recommended app preparation steps. These steps have been tested on macOS 10.15.

 

Important notes before you begin

  • For apps that require a kernel or system extension, the extension must be deployed as a macOS device configuration profile in Microsoft Endpoint Manager before the app is deployed. The app deployment will not complete successfully if the extension is included in the app package.
  • For apps that require a property list file (plist file), the property list file must be deployed using a macOS device configuration profile in Microsoft Endpoint Manager before the app is deployed. The app deployment will not successfully complete if the property list files are included in the app package.
  • The converted app must be re-signed for successful MDM-deployment. Unsigned applications are rejected by macOS. This also applies to DMGs containing PKG files.
  • It is crucial that the PKG files are created using the commands below. PKG files that are packaged using different packaging commands may not deploy successfully.
  • DMG files containing more than one APP file are not supported.
  • You will need to refer to How to add macOS line-of-business (LOB) apps to Microsoft Intune to complete the steps in the next section.

    Note: This is not an exhaustive list of all applicable conditions.

 

App preparation steps

The steps below require that you start with a DMG or APP app that satisfies the conditions above.

  1. Mount the DMG file.
    Note: Skip this step when starting with APP-format apps.
    hdiutil attach appname.dmg​
  2. Make a temporary folder and navigate to it.
    mkdir ./TargetDirectory
    mkdir ./TargetDirectory​
    cd ./TargetDirectory
  3. Build an intermediate PKG file.
    Note: When using autocomplete, delete the final slash in the APP path. Pass the install-location as an argument to the pkgbuild command.
    pkgbuild --install-location /Applications --component /Volumes/path_to_app/app_to_convert.app ./TargetDirectory/intermediate.pkg​
  4. Create the distribution XML file for the intermediate PKG file.
    Note: This is required to build a redistributable package.
    productbuild --synthesize --package /TargetDirectory/intermediate.pkg /TargetDirectory/distribution.xml​
  5. Build the final PKG file. This PKG file is not signed.
    productbuild --distribution ./distribution.xml --package-path ./intermediate.pkg ./unsigned_final.pkg​
  6. Sign the PKG file using a Mac Developer ID certificate.
    productsign --sign “3rd Party Mac Developer Installer: Developer Name (XXXX)” ./unsigned_final.pkg ./signed_final.pkg​
  7. Unmount the DMG file.
    Note: Skip this step when starting with APP-format apps.
    hdiutil detach /Volumes/appname​
  8. Create the INTUNEMAC file from the signed PKG file.
    ./IntuneAppUtil -c signed_final.pkg -o /finalpath​
  9. Add the INTUNEMAC file as a line-of-business application for macOS on Microsoft Endpoint Manager.

This sample script demonstrates how the above steps can convert a DMG file to INTUNEMAC.

 

Let us know by responding to this post if you have any questions or feedback! You can also ask questions by tagging @IntuneSuppTeam out on Twitter where our Support as a Feature team helps answer quick questions.

 

Post updates:

  • 07/22/20: With an update to the IntuneSuppTeam URL.
  • 03/08/22: You can now upload and deploy DMG-type applications to managed macOS devices from Microsoft Endpoint Manager using the required assignment type. For more information, see Add a macOS DMG app to Microsoft Intune.
  • 10/26/22: Refresh links and content specific to updates to Intune.
19 Comments
Version history
Last update:
‎Dec 19 2023 01:19 PM
Updated by: