If you deploy Slack with anything that isn’t VPP, you’ve probably run across the annoying instance where Slack will constantly prompt your users for admin credentials to update itself. This is all well and good if the user has admin rights, but if not, they’re stuck hitting cancel until you push a new version. Awful.
Some time ago a GitHub issue was opened for the update framework (Squirrel) and a long discussion was had about how MacAdmins were holding it wrong. That was updated today and this functionality has been added, albeit in a strange and poorly documented way.
The key is to set an environmental variable called SLACK_NO_AUTO_UPDATES, which the update mechanism will see and therefore skip the updates. The code in question:
Here’s how to enable this in your environment. Note, I strongly recommend you only do this if you’ll be tightly managing updates using a management toolset such as Munki, Jamf, or similar. Slack is essentially a web browser, and you want to make sure it has the latest updates as security problems pop up.
Take this gist, and save it into /Library/LaunchAgents as an appropriately named plist.
Load it and restart Slack, and you’re good to go. Note that any open apps (or apps that are re-opened after a reboot) will not see this, so you’ll need to ensure that Slack is fully quit and reopened somehow. You can test this by doing “env | grep SLACK_NO_AUTO_UPDATES” in your terminal – you should see the variable set.
edit: thank you Greg Neagle for pointing out that launchd doesn’t accept spaces in between commands. A previous version of the plist gist contained spaces, and while it worked, it’s not the most compatible solution.