Skip to main content

Worklet: Install Box client on Mac


Nic-Automox

This worklet will check to see if Box is installed and if it isn’t, will download and install it.

 

See this KB article for how to setup a worklet:

https://help.automox.com/hc/en-us/articles/5603324231700-Creating-a-Worklet

 

Evaluation Code:

 

 

#!/bin/bash



if [ -d "/Applications/Box Sync.app" ]; then

    exit 0

else

    exit 1

fi

 

Remediation Code:

 

 

#!/bin/bash



echo -e "Downloading Box Sync..."

curl -L -o "/tmp/Box Sync Installer.dmg" https://e3.boxcdn.net/box-installers/sync/Sync+4+External/Box%20Sync%20Installer.dmg



echo -e "Installing Box Sync..."

hdiutil attach "/tmp/Box Sync Installer.dmg" -nobrowse

ditto "/Volumes/Box Sync Installer/Box Sync.app" "/Applications/Box Sync.app"



echo -e "Cleaning up..."

hdiutil detach "/Volumes/Box Sync Installer"

rm -f "/tmp/Box Sync Installer.dmg"

This topic has been closed for comments

2 replies

Forum|alt.badge.img
  • Novice
  • 28 replies
  • March 3, 2021

Hi @Nic,

Jus wondering if you have the updated code for this worklet template? Box have two installer files right now, Box.pkg and BoxToolsinstaller.dmg.

Thanks!
Ulyssis


Nic-Automox
  • Author
  • Former Automox Employee
  • 832 replies
  • March 3, 2021

This is an old one and might need updating. The dmg file is the disk image that gets expanded, and it looks like the worklet is downloading that, mounting it, and copying the .app file to the applications directory.

A pkg file is a Mac installer that includes some scripts to put files in the right places and doesn’t just contain the .app file like the dmg file does. You might need to update the curl command to get the newer dmg file, or instead use the pkg file and run that to complete the install. Let me know if you get stuck and I can try getting it on my machine.

If you run it as is, does it actually install Box?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings