Skip to main content
Question

Install/update VLC


Forum|alt.badge.img+9

@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

13 replies

Forum|alt.badge.img+4
  • Contributor
  • 16 replies
  • July 20, 2017

Works perfect, thank you!


Forum|alt.badge.img
  • New Contributor
  • 1 reply
  • July 25, 2019

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.


Forum|alt.badge.img+3
  • New Contributor
  • 6 replies
  • November 18, 2019

Hi,
I modified the url http://mirror.rasanegar.com/videolan/vlc/last/macosx/ which is down
by https://get.videolan.org/vlc/3.0.8/macosx/
and it doesn't work

I have this error :
Executing Policy TEST Mise à jour VLC
Running script Mise à jour VLC...
Script exit code: 0
Script result: ditto: can't get real path for source '/VLC.app'

Do you know why please ?


Forum|alt.badge.img
  • New Contributor
  • 1 reply
  • November 18, 2019

Hi,
try to change the following lines:

URL to: https://get.videolan.org/vlc/last/macosx/
variable appVol vlc to VLC
appVol=`find /Volumes -type d -name VLC -maxdepth 1`

optional:
rm -f "/tmp/vlc.dmg"


Forum|alt.badge.img+3
  • New Contributor
  • 6 replies
  • November 19, 2019

I did for this line URL to: https://get.videolan.org/vlc/last/macosx/
I didn't for the others but i tryed an other script which do work :)

It's this one :

!/bin/bash

mkdir /tmp/downloads
cd /tmp/downloads

Installing VLC Player

CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep .dmg | grep -v webplugin | grep -v md5 | grep -v sha1 | grep -v sha256 | awk '{print $2}' | awk -F ">" '{print $2}' | tr -d "</a")

curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC

hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc
rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app
hdiutil unmount "/Volumes/vlc"
rm vlc.dmg
rm -rf /tmp/downloads

Inspired from GetMacApps.com


Forum|alt.badge.img+10
  • Valued Contributor
  • 179 replies
  • February 27, 2020

@cedric67 I used your script, But It does not install the VLC app... maybe.
Instead I am getting the following app installed, which launces nothing.
I looked at the info of this app, but it still has no information. Any ideas?
Some devices have 2.2.4 and we are attempting to update those devices with 3.0.8, while others have nothing installed. For those devices, I created a new 3.0.8 pkg using JAMF Composer, but that fails with an error about the signature. Both Catalina and Mojave OS and multiple devices.
Any help is much appreciated.


Forum|alt.badge.img+6
  • Contributor
  • 45 replies
  • February 27, 2020

This is what we used and set it to run once a mount on all device that had VLC installed.

#!/bin/bash

mkdir /tmp/downloads
cd /tmp/downloads

# Installing VLC Player
CurrentVLC=$(curl "http://get.videolan.org/vlc/last/macosx/" | grep .dmg | grep -v webplugin | grep -v md5 | grep -v sha1 | grep -v sha256 | awk '{print $2}' | awk -F ">" '{print $2}' | tr -d "</a")

curl -L -o vlc.dmg http://get.videolan.org/vlc/last/macosx/$CurrentVLC

hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc
rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app
hdiutil unmount "/Volumes/vlc"
rm vlc.dmg
rm -rf /tmp/downloads

Forum|alt.badge.img+10
  • Valued Contributor
  • 179 replies
  • February 27, 2020

So I tweaked the script above and it is now working without fail.
!/bin/bash
mkdir /tmp/downloads
cd /tmp/downloads

Installing VLC Player
*CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep .dmg | grep -v webplugin | grep -v md5 | grep -v sha1 | grep -v sha256 | awk '{print $2}' | awk -F ">" '{print $2}' | tr -d "</a")

curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC
rm -rf /Applications/VLC.app

hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc
rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app
sleep 10
hdiutil unmount "/Volumes/vlc"

rm vlc.dmg

rm -rf /tmp/downloads*

See below for changes.
sleep 20 to allow the dmg to load completely.
rm - rf /Applications/VLC.app - which removes the Application before it is reloaded
Commented out rm vlc.dmg - more simple to delete the entire folder /tmp/downloads*

These changes seemed to work on several different devices with Mojave and Catalina. If the device did not have the VLC app it installed it, if it did have any older VLC apps it updated them. Best of all VLC now works great!
Thanks for the great script @cedric67


Forum|alt.badge.img+10
  • Valued Contributor
  • 179 replies
  • February 28, 2020

Once again it is failing the install and update to VLC.
It is running through the script in like 3 seconds. Nothing noted in the install logs. While it was executing I tried to go to /tmp/downloads/ it does not locate any such folder. The script is in Shell. It does not appear to be creating the folder, therefore it is skipping a load of steps and errors out. JAMF Log> see the image.

Details do not reveal much, see image
/var/log/install.log says nothing of the script running.


Forum|alt.badge.img+8
  • New Contributor
  • 8 replies
  • August 4, 2021

@bmee we have been using your scrip and it was working great but it has now stopped. Is it still working for you or do you happen to have an update for it? Here is what this log is showing: 


Forum|alt.badge.img+3
  • New Contributor
  • 14 replies
  • December 13, 2021
ABigRock wrote:

@bmee we have been using your scrip and it was working great but it has now stopped. Is it still working for you or do you happen to have an update for it? Here is what this log is showing: 


I made some changes:

#!/bin/bash mkdir /tmp/downloads cd /tmp/downloads #Installing VLC Player CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "universal.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}') curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app sleep 20 hdiutil unmount "/Volumes/vlc" rm -rf /tmp/downloads*

I also created specific version for Intel and Arm:

Arm64:

#!/bin/bash mkdir /tmp/downloads cd /tmp/downloads #Installing VLC Player CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "arm64.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}') curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app sleep 20 hdiutil unmount "/Volumes/vlc" rm -rf /tmp/downloads*

Intel64:

#!/bin/bash mkdir /tmp/downloads cd /tmp/downloads #Installing VLC Player CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "intel64.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}') curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app sleep 20 hdiutil unmount "/Volumes/vlc" rm -rf /tmp/downloads*

Forum|alt.badge.img+3
  • New Contributor
  • 14 replies
  • December 13, 2021
mgeorgecv wrote:

I made some changes:

#!/bin/bash mkdir /tmp/downloads cd /tmp/downloads #Installing VLC Player CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "universal.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}') curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app sleep 20 hdiutil unmount "/Volumes/vlc" rm -rf /tmp/downloads*

I also created specific version for Intel and Arm:

Arm64:

#!/bin/bash mkdir /tmp/downloads cd /tmp/downloads #Installing VLC Player CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "arm64.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}') curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app sleep 20 hdiutil unmount "/Volumes/vlc" rm -rf /tmp/downloads*

Intel64:

#!/bin/bash mkdir /tmp/downloads cd /tmp/downloads #Installing VLC Player CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "intel64.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}') curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app sleep 20 hdiutil unmount "/Volumes/vlc" rm -rf /tmp/downloads*

I also created a script for an extension attribute:

#!/bin/bash CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "universal.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}' | tr -d '[a-z]' | sed 's/..$//' | cut -c 2-) if [ -d /Applications/VLC.app ]; then VLCversion=$( sudo defaults read /Applications/VLC.app/Contents/info.plist CFBundleVersion ) VLCcheck=$VLCversion else VLCcheck="Notinstalled" fi if [ "$VLCcheck" == "$CurrentVLC" ]; then #Is VLC up to date? result="VLCuptoDate" else result="VLCnotuptoDate" fi echo "<result>$result</result>"

Forum|alt.badge.img+3
  • New Contributor
  • 14 replies
  • January 10, 2022
mgeorgecv wrote:

I made some changes:

#!/bin/bash mkdir /tmp/downloads cd /tmp/downloads #Installing VLC Player CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "universal.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}') curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app sleep 20 hdiutil unmount "/Volumes/vlc" rm -rf /tmp/downloads*

I also created specific version for Intel and Arm:

Arm64:

#!/bin/bash mkdir /tmp/downloads cd /tmp/downloads #Installing VLC Player CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "arm64.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}') curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app sleep 20 hdiutil unmount "/Volumes/vlc" rm -rf /tmp/downloads*

Intel64:

#!/bin/bash mkdir /tmp/downloads cd /tmp/downloads #Installing VLC Player CurrentVLC=$(curl "https://get.videolan.org/vlc/last/macosx/" | grep "intel64.dmg<" | /usr/bin/sed -e 's/<[^>][^>]*>//g' | /usr/bin/awk '{print $1}') curl -L -o vlc.dmg https://get.videolan.org/vlc/last/macosx/$CurrentVLC hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app sleep 20 hdiutil unmount "/Volumes/vlc" rm -rf /tmp/downloads*

I then created Smart Groups and Policies to install the correct version on computers that were not up to date:


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings