AutomoxAutomox

Worklet: Install Box client on Mac

Nic-Automox
August 9, 2019 at 8:08 pm UTC

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:

 

 

bash13 lines
#!/bin/bash



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

    exit 0

else

    exit 1

fi

 

Remediation Code:

 

 

bash23 lines
#!/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 discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack

Replies (2)

uapiladoMarch 3, 2021
#1

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-AutomoxMarch 3, 2021
#2

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?