I am attempting to deploy Slack to our macOS Ventura devices via a curl script. When a user launches the app for the first time, they get a pop-up that says '"Slack" is damaged and can't be opened. you should move it to the Trash. '
This is only occurring in Ventura. If I download the software manually through the same URL I am calling in the curl script and install it normally, it works fine. Is there something new I have to do to get past the gatekeeper in macOS Ventura? This worked in Monterey.
The script in question:
#!/bin/bash
# this is the full URL
url="https://slack.com/ssb/download-osx-universal"
# change directory to /private/tmp to make this the working directory
cd /private/tmp/
# download the installer
/usr/bin/curl -L $url -o slack-desktop-latest.dmg
# mount the dmg
hdiutil attach slack-desktop-latest.dmg -nobrowse
# check if ~/Applications exists and create it if not
DIRECTORY=~/Applications
if [ -d "$DIRECTORY" ]; then
echo "$DIRECTORY exists"
elif [ ! -d "$DIRECTORY" ]; then
echo "$DIRECTORY does not exist"
mkdir $DIRECTORY
fi
# copy app to ~/Applications
cp -rf /Volumes/Slack/Slack.app ~/Applications/
# modify permissions for ~/Applications
chown $3: ~/Applications
chmod u+w ~/Applications
# unmount the dmg and remove the installer
hdiutil detach -force -quiet /Volumes/Slack
/bin/rm -f slack-desktop-latest.dmg
exit 0