Skip to main content

My company has several application programmers and about a dozen content producer that use Unity3D for designing iOS application and content for those applications. This means that they need to have the Unity IDE installed and maintained on their systems.



My users don't have admin access, and Unity puts out patches weekly that have to be deployed. More annoying is their update requires you download a download agent every week and select which modules you want, and it does a fresh install every time.



Has anyone found a way to manage this through scripts or self service? I have been unable to figure anything out besides downloading and installing it every week onto a VM and using Composer to make a new package. This is very time consuming though.

@allanp81



Ran across this problem. My current environment is running 10.14.6 deploying Unity 2019.2.17f1. Found the following issues After activating Unity on our Macs:




  • First Test User who logs in and runs Unity can run Unity fine without issues. But the permissions and ownership of the /Library/Application Support/Unity/Unity_lic.ulf changes and the current logged in user who ran Unity now owns Unity.

  • Second Test User logs in and cannot run Unity. "Unity Hub wants to make changes" prompt comes up asking for the admin password. This is the software asking to read the Unity License. If you create a project for Unity then the license permission ownership changes to the new currently logged in user.



Incredibly frustrating. So I created a script that will:




  1. Create a login Hook that will reset the permissions to 777 on the license file.

  2. Create a Start up Script that will also reset the permissions to 777.



* Please note that my environment we have SIPS disabled. For SIP enabled computers You can probably create the login Hook using a Policy that can do the equivalent of running "defaults write com.apple.loginwindow LoginHook /Library/Scripts/Pratt/pratt_it_chris_unityLicensefix.sh"



I have not tested this on a SIP enabled machine. But I thought it would be worth mentioning here.



#!/bin/bash

# Christian Orellana
# January 2020
# Academic Computing
# Install Plist and Bash script for Unity License Fix

### FUNCTIONS

RemoveLoginandStartHook() {

launchctl unload -w /Library/LaunchDaemons/com.pratt.it.chris.UnityLicense.plist

}

removePlist() {

rm /Library/LaunchDaemons/com.pratt.it.chris.UnityLicense.plist

}

removeBash() {

rm /Library/Scripts/Pratt/pratt_it_chris_unityLicensefix.sh

}

createBashScript() {

mkdir /Library/Scripts/Pratt
touch /Library/Scripts/Pratt/pratt_it_chris_unityLicensefix.sh

cat << 'EOF' >> /Library/Scripts/Pratt/pratt_it_chris_unityLicensefix.sh
#!/bin/bash

# Christian Orellana
# January 2020

# Unity License Fix

## RUN CODE

chown -R root:wheel /Library/Application Support/Unity; chmod -R 777 /Library/Application Support/Unity

exit 0
EOF

chown root:wheel /Library/Scripts/Pratt/pratt_it_chris_unityLicensefix.sh
chmod 644 /Library/Scripts/Pratt/pratt_it_chris_unityLicensefix.sh
chmod +x /Library/Scripts/Pratt/pratt_it_chris_unityLicensefix.sh

}

createPlist() {

touch /Library/LaunchDaemons/com.pratt.it.chris.UnityLicense.plist

cat << 'EOF' >> /Library/LaunchDaemons/com.pratt.it.chris.UnityLicense.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.pratt.it.chris.UnityLicense</string>
<key>Program</key>
<string>/Library/Scripts/Pratt/pratt_it_chris_unityLicensefix.sh</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOF

chown root:wheel /Library/LaunchDaemons/com.pratt.it.chris.UnityLicense.plist
chmod 644 /Library/LaunchDaemons/com.pratt.it.chris.UnityLicense.plist

}

InstallLoginHookandStartUpHook() {

# Start Up / boot up hook
launchctl load -w /Library/LaunchDaemons/com.pratt.it.chris.UnityLicense.plist

# Log in Hook
defaults write com.apple.loginwindow LoginHook /Library/Scripts/Pratt/pratt_it_chris_unityLicensefix.sh

}

## RUN

RemoveLoginandStartHook
removePlist
removeBash
createBashScript
createPlist
InstallLoginHookandStartUpHook

exit 0


Hope anyone finds it useful.


Hello,



Just wanted to add my $0.02.



I found as everyone else did that Unity Technologies added "Unity Hub" to the mix while I was preparing deployment of Unity 2019.4.4f1.



With that said, deployment methodology from previous versions worked for me.



1) Download all packages for your desired release of Unity from here:
https://unity3d.com/get-unity/download/archive
2) Copy the Visual Studio .app from the DMG (if needed) to /Applications, package with Composer.
3) Upload all packages to Jamf, setting priority on each package so that they install in the proper order.
4) Create a policy that installs all the packages.
5) Create a second policy that (either as a script or as an execute command item) runs the following:
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -serial Your-Super-Duper-Unity-Serial-Number -username 'YourSuperDuper@unity.account' -password 'YourSuperDuperUnityPassword' || :



This secondary policy needs to run once per machine, so I assigned it as a self-service item and instructed the students/technicians in the labs where the software is used that if they need to run Unity, someone needs to first run this icon, that way we only end up activating the product on machines it will actually be used on.



One thing to keep in mind is that for whatever reason (and this was true with the 2018 version too) the very first person to run this activation icon ends up with a broken unity install, so typically the instructors notify us or the technicians in the area of their intention to teach the product, and a technician that won't be using the software does this ahead of time.


So in a edu lab setting would it make sense to get the students to just sign in via the Unity Hub?