Skip to main content
Jamf Nation, hosted by Jamf, is a knowledgeable community of Apple-focused admins and Jamf users. Join us in person at the ninth annual Jamf Nation User Conference (JNUC) this November for three days of learning, laughter and IT love.

Install/update VLC

@dan.kubley this is a similar script to yours I wrote, but allows me to get the latest version.

Hope it helps

#!/bin/bash

# script to update vlc
find /Volumes -type d -name *vlc* -maxdepth 1 -exec hdiutil detach -quiet {} \;
if [[ -e "/tmp/vlc.dmg" ]]; then
    rm "/tmp/vlc.dmg"
fi

# download and mount VLC
appName=`curl -s http://mirror.rasanegar.com/videolan/vlc/last/macosx/ | perl -pe 's/.*(vlc-.*dmg).*./$1/' | grep "vlc-" | tail -n1`
appURL="http://mirror.rasanegar.com/videolan/vlc/last/macosx/$appName"
curl -Lo "/tmp/vlc.dmg" "$appURL" --silent
hdiutil attach "/tmp/vlc.dmg" -nobrowse -quiet

# Install VLC
appVol=`find /Volumes -type d -name *vlc* -maxdepth 1`
ditto -rsrc "$appVol/VLC.app" "/Applications/VLC.app"
chown -R root:wheel "/Applications/VLC.app"
chmod -R 755 "/Applications/VLC.app"
sleep 3
hdiutil detach "$appVol" -quiet
sleep 3
rm "/tmp/vlc.dmg"
sleep 1
open "/Applications/VLC.app" &

exit 0
Like Comment
Order by:
SOLVED Posted: by mecklind

Works perfect, thank you!

Like
SOLVED Posted: by MattP

This script works for me but it's also grabbing one version behind the latest release. It's currently installing 3.0.4 but if I manually go to the URL in the script it shows that 3.0.7.1 is the latest.

Like