Install the latest version of Brave Browser

AdamCraig
Contributor III

Modified a script that does the same thing for chrome. But this script will download and install the latest version of Brave directly from their web site

#!/bin/sh

dmgfile="Brave-Broswer.dmg"
volname="Brave Browser"
logfile="/Library/LogsBraveInstallScript.log"

url='https://brave-browser-downloads.s3.brave.com/latest/Brave-Browser.dmg'


/bin/echo "--" >> ${logfile}
/bin/echo "`date`: Downloading latest version." >> ${logfile}
/usr/bin/curl -s -o /tmp/${dmgfile} ${url}
/bin/echo "`date`: Mounting installer disk image." >> ${logfile}
/usr/bin/hdiutil attach /tmp/${dmgfile} -nobrowse -quiet
/bin/echo "`date`: Installing..." >> ${logfile}
ditto -rsrc "/Volumes/${volname}/Brave Browser.app" "/Applications/Brave Browser.app"
/bin/sleep 10
/bin/echo "`date`: Unmounting installer disk image." >> ${logfile}
/usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep "${volname}" | awk '{print $1}') -quiet
/bin/sleep 10
/bin/echo "`date`: Deleting disk image." >> ${logfile}
/bin/rm /tmp/"${dmgfile}"

exit 0
3 REPLIES 3

bradsschroeder
New Contributor III

@strayer Thanks for tagging this with Jamf Nation. I think this would be better off just tagged with patch management as that is the primary function. Please let me know if you disagree with the removal of the Jamf Nation tag.

EvanVC15
New Contributor

Hey Adam,

 

I get a message when using the script above:

 

EvanVC15_0-1675915669796.png

 

Have experienced this issue at all?

It's possible that with M1 architecture this is no longer downloading the correct version of the application? or there could be an OS compatibility issue.
I am no longer using this script my self I'm using Installomator for this purpose now. https://github.com/Installomator/Installomator