Posted on 01-11-2024 10:18 AM
Good afternoon,
I need to deploy Blender to a couple of computer labs. Since its a drag and drop application, how do I prep this for deployment without a package?
Solved! Go to Solution.
Posted on 01-12-2024 07:15 AM
For drag and drop dmg apps like this, I always use a script like below. The tricky part is finding a good "latest" URL to use.
I've poked around the Blender site a bit and I'm not finding an easy way to do that, so you may have to update your script periodically as new versions are released, unless you can find a clever path to use.
Blender also has Intel and ARM specific installer packages, so I've included a switching function I use for that as well.
It's a good pattern to use and doesn't usually require a lot of modification. Good luck!
#!/bin/bash
set -e
# Vendor supplied DMG file
VendorDMG="blender.dmg"
VendorMnt="/Volumes/Blender"
VendorApp="Blender.app"
# VendorDownload="" # "Latest" download link, if universal
VendorDownloadARM="https://www.blender.org/download/release/Blender4.0/blender-4.0.2-macos-arm64.dmg"
VendorDownloadIntel="https://www.blender.org/download/release/Blender4.0/blender-4.0.2-macos-x64.dmg"
TempLog="/tmp/blender.log"
# Evaluate if this is arm or x86 and set install dir appropriately
if [[ $(uname -m) == 'arm64' ]]; then
# Apple Silicone
VendorDownload=$VendorDownloadARM
else
VendorDownload=$VendorDownloadIntel
fi
# Download vendor supplied DMG file into /tmp/
echo "Starting download: ${VendorDownload}" | tee -a $TempLog
curl -4 -sSL "${VendorDownload}" -o "/tmp/${VendorDMG}" | tee -a $TempLog
# Mount vendor supplied DMG File
echo "Mounting..." | tee -a $TempLog
hdiutil attach "/tmp/${VendorDMG}" -nobrowse | tee -a $TempLog
# Copy contents of vendor supplied DMG file to /Applications/
# Preserve all file attributes and ACLs
echo "Copying to Applications..." | tee -a $TempLog
cp -pR "${VendorMnt}/${VendorApp}" /Applications/ | tee -a $TempLog
# Identify the correct mount point for the vendor supplied DMG file
echo "Identifying Mountpoint..." | tee -a $TempLog
MntDev="$(hdiutil info | grep "${VendorMnt}" | awk '{ print $1 }')" | tee -a $TempLog
# Unmount the vendor supplied DMG file
echo "Dismounting..." | tee -a $TempLog
hdiutil detach $MntDev | tee -a $TempLog
# Remove the downloaded vendor supplied DMG file
echo "Cleaning up..." | tee -a $TempLog
rm -f /tmp/$VendorDMG
rm $TempLog
echo "Done!"
Posted on 01-11-2024 10:33 AM
Composer or Simple Package Creator (getting old but works)
Posted on 01-11-2024 11:40 AM
I never went back to fix the .ZIP -> .app handling, but for .DMG it still works well enough to create a Universal .PKG.
https://github.com/da4ftso/build/blob/main/Blender_4.0.2-Universal.zsh
Posted on 01-11-2024 11:42 AM
dead link?
Posted on 01-12-2024 08:01 AM
Derp, sorry, that was a private repo - updated to public, please retry.
Posted on 01-11-2024 01:07 PM
I would use JAMF Composer to package it. However, JAMF can deploy DMG's and with some scripting you can move the .app from the dmg to /Applications and unmount the DMG.
Posted on 01-12-2024 07:15 AM
For drag and drop dmg apps like this, I always use a script like below. The tricky part is finding a good "latest" URL to use.
I've poked around the Blender site a bit and I'm not finding an easy way to do that, so you may have to update your script periodically as new versions are released, unless you can find a clever path to use.
Blender also has Intel and ARM specific installer packages, so I've included a switching function I use for that as well.
It's a good pattern to use and doesn't usually require a lot of modification. Good luck!
#!/bin/bash
set -e
# Vendor supplied DMG file
VendorDMG="blender.dmg"
VendorMnt="/Volumes/Blender"
VendorApp="Blender.app"
# VendorDownload="" # "Latest" download link, if universal
VendorDownloadARM="https://www.blender.org/download/release/Blender4.0/blender-4.0.2-macos-arm64.dmg"
VendorDownloadIntel="https://www.blender.org/download/release/Blender4.0/blender-4.0.2-macos-x64.dmg"
TempLog="/tmp/blender.log"
# Evaluate if this is arm or x86 and set install dir appropriately
if [[ $(uname -m) == 'arm64' ]]; then
# Apple Silicone
VendorDownload=$VendorDownloadARM
else
VendorDownload=$VendorDownloadIntel
fi
# Download vendor supplied DMG file into /tmp/
echo "Starting download: ${VendorDownload}" | tee -a $TempLog
curl -4 -sSL "${VendorDownload}" -o "/tmp/${VendorDMG}" | tee -a $TempLog
# Mount vendor supplied DMG File
echo "Mounting..." | tee -a $TempLog
hdiutil attach "/tmp/${VendorDMG}" -nobrowse | tee -a $TempLog
# Copy contents of vendor supplied DMG file to /Applications/
# Preserve all file attributes and ACLs
echo "Copying to Applications..." | tee -a $TempLog
cp -pR "${VendorMnt}/${VendorApp}" /Applications/ | tee -a $TempLog
# Identify the correct mount point for the vendor supplied DMG file
echo "Identifying Mountpoint..." | tee -a $TempLog
MntDev="$(hdiutil info | grep "${VendorMnt}" | awk '{ print $1 }')" | tee -a $TempLog
# Unmount the vendor supplied DMG file
echo "Dismounting..." | tee -a $TempLog
hdiutil detach $MntDev | tee -a $TempLog
# Remove the downloaded vendor supplied DMG file
echo "Cleaning up..." | tee -a $TempLog
rm -f /tmp/$VendorDMG
rm $TempLog
echo "Done!"
Posted on 01-16-2024 03:43 PM
this worked great, thank you!