I tried that and it is supposed to bypass the initial prompt but its still doing it for me. How are you pushing that defualts command?
I just pushed a configuration profile to preferences domain com.tinyspec.slackmacgap.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SlackNoAutoUpdates</key>
<string>1</string>
</dict>
</plist>
Hope this is helpful!
It seems the proper command to run is:
defaults write com.tinyspeck.slackmacgap SlackNoAutoUpdates -string 1
I had a script to run
defaults write com.tinyspeck.slackmacgap SlackNoAutoUpdates -bool YES
which seemed to have worked up until recently. But then I started seeing the "check for updates" appear again in the Slack menu (it had disappeared when I first pushed out the above script).
According to https://slack.com/intl/en-gb/help/articles/360035635174-Deploy-Slack-for-macOS the new command is now:
defaults write Users/$USER/Library/Preferences/com.tinyspeck.slackmacgap.plist SlackNoAutoUpdates -bool YES
but that still shows the "check for updates" option in the Slack menu
@kishan.hirani I wonder if it shows "check for updates" because of the Slack installation permissions are set like at the bottom of the page: "Allow users to update Slack"
I'm also trying to figure out how to set this. I prefer a configuration profile but it looks like this is a per user setting I wonder if it can actually be set globally.
For a config profile do this:
defaults write ~/Documents/com.tinyspeck.slackmacgap.plist SlackNoAutoUpdates -bool YES
plutil -convert xml1 ~/Documents/com.tinyspeck.slackmacgap.plist
After you’ve created the plist above:
1. Create a new config profile in Jamf Pro
2. Choose app and custom settings
3. Choose upload plist and upload the plist (in ~/Documents) you created in the above steps and save it
This is the only way I've found to bypass the update request for standard users. Pushing updates manually or via patch management works well. I use this script I created to download the app and install it with permissions for the user.
#!/bin/zsh
#
# Created Aug 26 2020 by J Samuel Clark
# - Downloads a DMG file to extract an app or PKG and install on the user's computer
#
# Updated Oct 21 2020 by J Samuel Clark
# - Added support to quit application before installing
#
########################################################################
# About this program
#
# Variables which must be defined in Jamf Pro
#
# "$4" Represents the URL from where the DMG will be downloaded
# "$5" Represents what the DMG will be named after being downloaded
# "$6" The exact name of a .app file within the downloaded DMG
# "$7" The exact name of a .pkg within the downloaded DMG
#
# NOTE: A parameter must be set in either "$6" OR "$7", the script will
# fail otherwise. Enjoy!
#
########################################################################
# Defining variables - DO NOT MODIFY
########################################################################
downloadUrl="$4" # The URL must return a file
dmgName="$5" # The name of the file after it's downloaded
appName="$6" # Name of the .app file within the DMG
pkgName="$7" # Name of the .pkg file within the DMG
downloadLocation="/private/tmp" # Where the file gets downloaded
applicationDmg=""$downloadLocation"/"$dmgName"" # The location and name of the downloaded file
mountPoint="/Volumes/$dmgName"
loggedInUser=$(/usr/bin/stat -f%Su /dev/console)
# Preliminary checks
if [[ -n "$appName" ]] && [[ -z "$pkgName" ]]; then
installApp="$6"
elif [[ -n "$pkgName" ]] && [[ -z "$appName" ]]; then
installApp="$7"
elif [[ -z "$appName" ]] && [[ -z "$pkgName" ]]; then
echo "Nothing found in parameters, exiting"
exit 1
elif [[ -n "$appName" ]] && [[ -n "$pkgName" ]]; then
echo "Too many parameters set, exiting"
exit 1
fi
########################################################################
# Begin program - HOLD ONTO BUTTS
########################################################################
# Download and mount DMG
/usr/bin/curl -sL "$downloadUrl" -o "$applicationDmg"
/usr/bin/hdiutil attach "$applicationDmg" -mountpoint "$mountPoint" -nobrowse
# Choose which installation to run
installType=$( echo "$installApp" | cut -d '.' -f2 )
case "$installType" in
app )
# Killing and copying .app to /Applications folder
killApp=$(echo "$installApp" | cut -d '.' -f1 )
if [[ -n $(pgrep "$killApp") ]]; then
echo "Killing process "$killApp""
/usr/bin/killall "$killApp"
fi
echo "Copying "$appName" to Applications folder"
if [[ -a "/Applications/"$appName"" ]]; then
echo "Removing old instance of "$appName""
/bin/rm -r "/Applications/"$appName""
fi
#Checking if user is admin or standard and setting permissions
if [[ -n $(id -Gn $loggedInUser | grep "admin") ]]; then
echo "Installing app with admin rights"
/bin/cp -pR ""$mountPoint"/"$appName"" /Applications
/bin/chmod 755 /Applications/"$appName"
/usr/sbin/chown -R root:wheel /Applications/"$appName"
else
/bin/cp -pR ""$mountPoint"/"$appName"" /Applications
/bin/chmod 755 /Applications/"$appName"
/usr/sbin/chown -R "$loggedInUser":wheel /Applications/"$appName"
fi
;;
pkg )
# Installing .pkg within DMG to /
echo "Installing "$pkgName""
installer -pkg ""$mountPoint"/"$pkgName"" -target /
;;
* )
echo "Nothing to install"
;;
esac
# Cleanup
/usr/bin/hdiutil detach "$mountPoint"
/bin/rm "$applicationDmg"
exit
Here is an alternative to @ryan.ball 's method of using a config profile, where you can create a custom configuration and use the JSON schema to enable the SlackNoAutoUpdates
key within com.tinydesk.slackmacgap
. Both work equally well and do the same thing.
{
"$schema": "http://json-schema.org/schema#",
"title": "Slack Disable Auto-Updates",
"description": "This schema will enable the option to disable auto updates for Slack.app",
"properties": {
"SlackNoAutoUpdates": {
"type": "boolean",
"title": "Disable Auto-Updates for Slack.app",
"property_order": 5
}
}
}
What we have done (with success it seems so far) is:
- Create a script, a modified version of what was posted above
currentUser=`ls -l /dev/console | cut -d " " -f4`
sudo -u $currentUser defaults write com.tinyspeck.slackmacgap SlackNoAutoUpdates -bool YES
- Then create a profile that runs the script on a ongoing occurrence
I've tested that with Slack version 4.10.x
This is the only way I've found to bypass the update request for standard users. Pushing updates manually or via patch management works well. I use this script I created to download the app and install it with permissions for the user.
#!/bin/zsh
#
# Created Aug 26 2020 by J Samuel Clark
# - Downloads a DMG file to extract an app or PKG and install on the user's computer
#
# Updated Oct 21 2020 by J Samuel Clark
# - Added support to quit application before installing
#
########################################################################
# About this program
#
# Variables which must be defined in Jamf Pro
#
# "$4" Represents the URL from where the DMG will be downloaded
# "$5" Represents what the DMG will be named after being downloaded
# "$6" The exact name of a .app file within the downloaded DMG
# "$7" The exact name of a .pkg within the downloaded DMG
#
# NOTE: A parameter must be set in either "$6" OR "$7", the script will
# fail otherwise. Enjoy!
#
########################################################################
# Defining variables - DO NOT MODIFY
########################################################################
downloadUrl="$4" # The URL must return a file
dmgName="$5" # The name of the file after it's downloaded
appName="$6" # Name of the .app file within the DMG
pkgName="$7" # Name of the .pkg file within the DMG
downloadLocation="/private/tmp" # Where the file gets downloaded
applicationDmg=""$downloadLocation"/"$dmgName"" # The location and name of the downloaded file
mountPoint="/Volumes/$dmgName"
loggedInUser=$(/usr/bin/stat -f%Su /dev/console)
# Preliminary checks
if [[ -n "$appName" ]] && [[ -z "$pkgName" ]]; then
installApp="$6"
elif [[ -n "$pkgName" ]] && [[ -z "$appName" ]]; then
installApp="$7"
elif [[ -z "$appName" ]] && [[ -z "$pkgName" ]]; then
echo "Nothing found in parameters, exiting"
exit 1
elif [[ -n "$appName" ]] && [[ -n "$pkgName" ]]; then
echo "Too many parameters set, exiting"
exit 1
fi
########################################################################
# Begin program - HOLD ONTO BUTTS
########################################################################
# Download and mount DMG
/usr/bin/curl -sL "$downloadUrl" -o "$applicationDmg"
/usr/bin/hdiutil attach "$applicationDmg" -mountpoint "$mountPoint" -nobrowse
# Choose which installation to run
installType=$( echo "$installApp" | cut -d '.' -f2 )
case "$installType" in
app )
# Killing and copying .app to /Applications folder
killApp=$(echo "$installApp" | cut -d '.' -f1 )
if [[ -n $(pgrep "$killApp") ]]; then
echo "Killing process "$killApp""
/usr/bin/killall "$killApp"
fi
echo "Copying "$appName" to Applications folder"
if [[ -a "/Applications/"$appName"" ]]; then
echo "Removing old instance of "$appName""
/bin/rm -r "/Applications/"$appName""
fi
#Checking if user is admin or standard and setting permissions
if [[ -n $(id -Gn $loggedInUser | grep "admin") ]]; then
echo "Installing app with admin rights"
/bin/cp -pR ""$mountPoint"/"$appName"" /Applications
/bin/chmod 755 /Applications/"$appName"
/usr/sbin/chown -R root:wheel /Applications/"$appName"
else
/bin/cp -pR ""$mountPoint"/"$appName"" /Applications
/bin/chmod 755 /Applications/"$appName"
/usr/sbin/chown -R "$loggedInUser":wheel /Applications/"$appName"
fi
;;
pkg )
# Installing .pkg within DMG to /
echo "Installing "$pkgName""
installer -pkg ""$mountPoint"/"$pkgName"" -target /
;;
* )
echo "Nothing to install"
;;
esac
# Cleanup
/usr/bin/hdiutil detach "$mountPoint"
/bin/rm "$applicationDmg"
exit
Here is an alternative to @ryan.ball 's method of using a config profile, where you can create a custom configuration and use the JSON schema to enable the SlackNoAutoUpdates
key within com.tinydesk.slackmacgap
. Both work equally well and do the same thing.
{
"$schema": "http://json-schema.org/schema#",
"title": "Slack Disable Auto-Updates",
"description": "This schema will enable the option to disable auto updates for Slack.app",
"properties": {
"SlackNoAutoUpdates": {
"type": "boolean",
"title": "Disable Auto-Updates for Slack.app",
"property_order": 5
}
}
}
{
"$schema": "http://json-schema.org/schema#",
"title": "Slack Supported settings",
"description": "This schema will enable the option to disable auto updates for Slack.app",
"properties": {
"AutoUpdate": {
"type": "boolean",
"title": "AutoUpdate",
"description": "Enables or disables automatic updates of the desktop app",
"default": false
},
"ClientEnvironment": {
"type": "integer",
"title": "ClientEnvironment",
"description": "Configures the client to run in either commercial mode or government compliance mode (GovSlack).",
"enum": [
1000,
1001
],
"default": 1000
},
"DefaultSignInTeam": {
"type": "string",
"title": "DefaultSignInTeam",
"description": "Sets a default workspace URL for users to sign into on first launch. A valid workspace ID should be typed in.",
"default": "your-workspace-id"
},
"DownloadPath": {
"type": "string",
"title": "DownloadPath",
"description": "Configures a download location.",
"default": "/tmp/downloads"
},
"HardwareAcceleration": {
"type": "boolean",
"title": "HardwareAcceleration",
"description": "Enables or disables hardware accelerated rendering on the client.",
"default": true
}
}
}
Here is an updated version of all supported settings for Slack (Source of available settings can be found here)