How to Install Slack for macOS using JumpCloud Commands

** December 2020 Update ** – This script has been updated, so when it mounts the DMG it now doesnt pop up wiht the folder. So it is completly silent in the background

The next script talks you through how to install Slack for macOS using JumpCloud Commands. It follows a similar structure to the other commands I have posted. Creates a temp repo on the mac, Kills the old version, removes the old version, downloads the latest version, mounts, installs, and removes the temp files. Simple but effective. I have broken this out of this post as I am separating all of the commands into there own blog post.

Install Slack for macOS using JumpCloud Commands.

# Script to download, Silent Install and then clean up once installed Slack
# Writen by twitter.com/richhickson
# www.RichardHickson.com

#Kill Old Version
killall Slack

#Remove Old Version of Slack
sudo rm -rf /Applications/Slack.app/

#Make temp folder for downloads.
mkdir "/tmp/slack/";
cd "/tmp/slack/";

#Download Slack.
curl -L -o /tmp/slack/slack.dmg "https://slack.com/ssb/download-osx";

#Mount DMG
hdiutil attach /tmp/slack/slack.dmg -nobrowse;

#Copy App to Applications
sudo cp -R "/Volumes/Slack/Slack.app" /Applications;

#Open Slack
open /Applications/Slack.app

#Unmount DMG
hdiutil detach /Volumes/Slack -force;

#tidy up
sudo rm -rf "/tmp/slack";

4 thoughts on “How to Install Slack for macOS using JumpCloud Commands”

  1. Hi Richard,

    This is my first time trying to run one of your scripts. If I am trying to copy and paste this script for testing what is the format that I should be using?

    Regards,

    Evan

    Reply

Leave a Comment