SCCM: Wrapping Mac OS X Apps using CMAppUtil
Introduction
In this article, we demonstrate how you can easily wrap an OS X App for Distribution via System Center Configuration Manager. The Wrapped App can later be deployed as an Application to managed Mac Devices.
For the Wrapping, you need a Windows device to install the Mac Client Installer and a Mac Device to perform the actual Wrapping.
Getting CMAppUtil
CMAppUtil, which we use for the Wrapping-Process, is part of the ConfigMgr Mac Client. The Mac Client can be found on Microsoft Download as part of the Clients for Additional Operating Systems.
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part1.png
Download the ConfigmgrMacClient.msi
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part2.png
Install the "System Center Configuration Manager for Mac client Setup" on a Test device.
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part3.png
Copy the installed dmg file to a Mac OS X Device. The file is located at:
C:\Program Files (x86)\Microsoft\System Center Configuration Manager for Mac client\macclient.dmg
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part4.png
Open macclient.dmg on the Mac.
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part5.png
Copy the Tools folder to a place on the Mac. We use the Desktop for this example.
Getting the Apps
In this example, we will wrap Google Chrome and Citrix Receiver. Whichever app you are going to wrap, CMAppUtil supports the following formats:
- .dmg
- .pkg
- .mpkg
- .app
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part6.png
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part7.png
As you see the installers for the two applications that we choose to look at are a bit different. Google Chrome is a native app (.app) which can just be put into the Applications Folder. Citrix Receiver, however, is an iInstaller (.pkg).
Wrapping a .app file (Google Chrome)
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part8.png
Open Terminal on the Mac and navigate into the Tools folder where CMAppUtil is located. You can use 'cd' to change directories and 'ls' to list the content of the present directory.
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part9.png
Use the following command to start the Wrapping process. Adjust the path if needed.
./CMAppUtil -c "/Users/macbookpro/Desktop/googlechrome.dmg" -o "/Users/macbookpro/Desktop/Wrapped/"
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part10.png
After a short while, the Wrapping Process should complete with the above message. If the dmg file is opened during the wrapping, ignore it.
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part11.png
Your app should now be available in the specified Output Directory in the .cmmac format, as on the screen above.
Wrapping a .pkg App (Citrix Receiver)
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part12.png
The process of wrapping a .pkg file is exactly the same as in the example above. However, here we have the situation, that the specified .dmg has two executables in it. CMAppUtil will pause the wrapping and ask, you as seen above, to choose the correct installer. In this example 1.
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part13-1.png
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part14.png
After a short while, the Wrapping should complete, leaving you with another .cmmac file in the Output Directory.
In case if you need to convert all the applications inside the .dmg file then use -a property at the end.
./CMApputil -c "path to .dmg" -o "destination location" -a
When converting if you see any issue like the below screen then use -s property to force create .cmmac without any detection.xml file. In this case, we need to explicitly create detection method manually in the SCCM console.
If you want to review the detection.xml file created using CMApputil which is wrapped inside the CMMAC file using terminal then use -r property.
./CMApputil -r "path to .cmmac file"
Analyzing the .cmmac file
At last, let's have a closer look at what CMAppUtil has exactly done with the wrapped Application.
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part15.png
The .cmaac is an Archive File which can be opened an extract on any Windows or Mac Device.
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part17.png
contents: Contains the original, unmodified Installation File. In this example either "Google Chrome.app" or "Install Citrix Receiver.pkg"
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part16.png
Metadata: Contains a file called Detection.xml
The Detection.xml contains, as the name implies, the Detection Method which is mandatory for creating an Application in ConfigMgr. It also contains some basic Installation Parameter as where to install the Application. Those Settings are automatically being used when importing the .cmmac file into ConfigMgr
https://msitproblog.com/wp-content/uploads/2017/03/osx_wrap_app_part18.png