top of page
  • Writer's pictureGareth Oxendine

Using a Script and Intune to Deploy macOS Applications

Sometimes Intune's macOS application deployments aren't successful no matter which deployment method you use. Alternatively, you can deploy an Intune script to install the application! See below to learn how.


Table of Contents


Prerequisites

Before we continue, please note that this script requires the installer file(s) to be located in cloud storage and publicly accessible with a shared link. For example, I use Azure Blob Storage, but other options include but are not limited to, Box or Dropbox.


Using a public link means that anyone with the link can view and download the installer file(s). Ensure that the file(s) do not contain sensitive or proprietary data. A best practice is to delete or nullify the shared link shortly after the script is deployed to prevent unauthorized access.


Creating the Script

Below are the script templates; underneath them, I'll explain the different parts and pieces.



Script Template for DMG Installers

  • First, this script checks to see if the application is already installed on the end user's machine; if it is, it will exit with a success code (0). Change the application path as needed.

  • Next, if the application is not already installed, then the script will do the following:

    • Create a subfolder in the /tmp folder. Change the folder name to whatever you'd like. Please note that items in the /tmp folder are deleted automatically when the computer is rebooted or after a short period if unused; this makes it the perfect place to download the installer file(s).

    • Use the cURL command to download the installer file(s). (Change the names of the files and folders in the file paths as needed.)

    • Mount the DMG file and use the installer command to install it. (To find the volume's name, mount the DMG on a test computer and use Finder to view it.)

    • Pause the script while the application is installed.

    • Unmount the DMG.


Script Template for PKG Installers

  • First, this script checks to see if the application is already installed on the end user's machine; if it is, it will exit with a success code (0). Change the application path as needed.

  • Next, if the application is not already installed, then the script will do the following:

    • Create a subfolder in the /tmp folder. Change the folder name to whatever you'd like. Please note that items in the /tmp folder are deleted automatically when the computer is rebooted or after a short period if unused; this makes it the perfect place to download the installer file(s).

    • Use the cURL command to download the installer file(s). (Change the names of the files and folders in the file paths as needed.)

    • Use the installer command to install it. (Change the names of the files and folders in the file paths as needed.)

    • Pause the script while the application is installed.


Deploying the Script using Intune

Once the script is written and saved, you can deploy it to your devices using Intune. Click the link below to learn how to deploy scripts to macOS devices using Intune.






Cover Picture provided by Freepik

28 views0 comments

Comentários


Recent Posts

Like this Article?

If this information was helpful, we want to know!

Leave a like by clicking the heart at the bottom of the page. 

Next Coffee on You?

We hope this article was helpful to you! If so, want to send a donation as a form of thanks? Just click the coffee cup!  :)

bottom of page