This article is contributed. See the original author and article here.

By: Arnab Biswas | Program Manager – Microsoft Endpoint Manager – Intune

You can use Microsoft Endpoint Manager 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, for apps that are of non-pkg types, it requires admins to run commands on macOS either manually or as a script to create a signed app package (.intunemac file) 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.

 

1. 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 complete successfully 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 the Microsoft Intune App Wrapping Tool for macOS to complete the steps in the next section. Follow these instructions to set up the App Wrapping Tool correctly.
  • This is not an exhaustive list of all applicable conditions.

 

2. App preparation steps

The steps below require that you initiate with an app of DMG or APP format that satisfy 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.

Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.