Friday, March 9, 2018

How Ivanti Handles Your macOS Package

Ivanti's software distribution client for macOS (sdclient) has some special built in behavior based on the file extension of the file being deployed. This article goes through each file type we support and explains what we will do with it.
This table contains a summary of the file extensions we will handle in a special way and what we will try to do with them.


File ExtensionAction
.dmg, .img, .smi, .iso Mount them then look for grab the first file and handle it recursively.
.zip, .bzip, .gz, .z, .tar, .tgzUncompress them and handle the contents recursively.
.pkg, .mpkgCall the command line version of the installer.
.sh Run the script as root.
.workflowRun with automator
.ldpatchThey should be a tgz file (renamed to a ldpatch file) with a subdirectory called Update and a script in the Update directory called postflight. We run postflight and clean up.
.mobileconfigInstall a configuration profile as the primary user of the machine
.prefPane (Case sensitive)Copy to /Library/PreferencePanes
.saverCopy to /Library/Screen Savers
.ttf or .dfontCopy to /Library/Fonts
Any other extensionCopy to /Applications

Conceptually, there are two classes of files we support; archives and files. This gets a little confusing since some .pkg and .mpkg files aren't files at all but are actually directories but, for the sake of simplicity, let's just call them files.
Archives are files that contain one or more arbitrary files. Things like zip files and .tgz files are good examples. We have taken one or more files and compressed them into a single file. Disk image files like .dmg files are also treated as archives. When sdclient sees an archive, it opens it up then looks for the first file contained in the archive. It then applies the appropriate action to that file. For example, if I have a .zip file that contains a .pkg file, sdclient would unzip the zip file into a temporary directory, find the .pkg since it is the first and only file in the zip, and run installer on it. If I have a single .app file in a .dmg, sdclient would mount the .dmg file, see the .app file, and copy it into /Applications. If, for some strange reason, I had a .zip file that contained a .dmg file that contained a .tff file, sdclient would unzip the zip file, see the .dmg file, mount the .dmg file, see the .tff file, and copy it into /Library/Fonts. Files are considered alphabetically. If a .dmg contained two files called installit.sh and application.app, installit.sh would get ignored and application.app would be moved into the "/Applications" folder.
All Apple .app files and older .pkg and .mpkg files are not actually files. They are folders. Finder hides this but have no doubt, you can not just copy on of these "files" to an http server and point an Ivanti SWD package at it. They must be contained in some sort of archive for distribution.
Keep in mind that sdclient is used for both software distribution and patch. If you are writing custom patches, you patch content will follow these same rules.
sdclient is a powerful tool. It integrates with Ivanti's Targeted Multicast service as well as peer to peer download and preferred server facilities. It also supports both http(s) and smb package sources. Hopefully, this short article will help you take advantage of sdclient's behaviors as you create your own packages and patches.