Posted on 02-12-2016 02:50 PM
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.
Posted on 02-12-2016 09:08 PM
One thing that can make it a little bit easier.
If you run the download application on a machine all the way through to the end but don't quit it there will be folder in Downloads that contains all the PKG files it pulled down and an INI file describing them.
The moment you quit the Installer they are all deleted, but you can copy them out before this.
You can use these to create an install process without using Composer etc... The INI file appears to list the packages in the order they are to be installed and even has the PKG name as well.
I just pushed all the PKGs down in a DMG and then had a script read the names out of the INI and install them in order.
I'll find it for you when I am back in the office.
Posted on 02-14-2016 12:05 PM
Reads the package names from the URL line of the install.ini described above and installs them in the order in which they appear.
I just placed all the downloaded files into /Library/Scripts/UnityPackages but of course you could use any location that takes your fancy.
#!/bin/bash
for Unity_PKG in $(awk -F"/" '/url=/ {print $NF}' < /Library/Scripts/UnityPackages/install.ini); do
installer -pkg "/Library/Scripts/UnityPackages/$Unity_PKG" -target /
done
rm -rf /Library/Scripts/UnityPackages
Posted on 03-01-2017 07:25 AM
Thanks much for this tip & script.
Has anyone seen how to automate the last mile of installation (aka user account login and serialization) for macOS? I know people have been asking for this feature so it's something they'll likely release at some point, but the most I found was batch file activations and that was for Windows clients...If anyone has figured this out I would love to hear their solution.
Posted on 06-21-2017 06:35 AM
There is a "silent serialization" script that works great when you run it thru ARD, but for the life of me I cannot get it to work in Casper. I even modified it so that it runs as the currently logged-in user (the user running the script has to own a GUI session, so you can't run it as root). If anyone else has solved this problem, I'd really appreciate hearing about it. I do not want to use the "at login" trigger because they're never reliable.
The basic syntax looks like this:
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -serial R3-XXXX-XXXX-XXXX-XXXX-XXXX -username 'somebody@example.com' -password 'MyPassw0rd'
Posted on 09-12-2017 10:48 PM
Have found anybody a solution?
Posted on 09-13-2017 07:16 AM
I'm hoping to find a solution to this since I'm going to be installing this in some of our labs.
If I manage to get it working, I'll post something.
Posted on 09-18-2017 07:31 AM
Unfortunately, I had to go the manual route (Grab packages, use script, login, ARD and run the batchmode command).
I did do a test to run the batchcommand at login and it did work, but I also don't like login policies that much.
Posted on 09-19-2017 12:08 PM
can you send me the batchcommand which you uses for login policies?
I tryed, but by us doesn't work that.
Posted on 09-20-2017 07:07 AM
It was the same as above but I made it run when the dock loaded to give it a little buffer:
#!/bin/sh
until [[ $(pgrep Dock) ]]; do
wait
done
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -serial R3-XXXX-XXXX-XXXX-XXXX-XXXX -username 'somebody@example.com' -password 'MyPassw0rd'
Posted on 09-25-2017 11:37 PM
Executing Policy ActivatingUnity
Running script ActivateUnity...
Script exit code: 139
Script result: 2017-09-26 08:34:59.777 Unity[898:5768] NSDocumentController Info.plist warning: The values of CFBundleTypeRole entries must be 'Editor', 'Viewer', 'None', or 'Shell'.<br/>...270213 bytes written to /var/root/Library/Unity/Certificates/CACerts.pem<br/>/Library/Application Support/JAMF/tmp/ActivateUnity: line 7: 898 Segmentation fault: 11 /Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -serial -serial R3-XXXX-XXXX-XXXX-XXXX-XXXX -username 'somebody@example.com' -password 'MyPassw0rd'<br/>
Error running script: return code was 139.
we get this error. How can we solve this?
Posted on 01-29-2018 09:46 PM
Hello
I found a solutions. If some instred, let me know. But it is not automatic.
Greetings
Posted on 01-30-2018 06:15 AM
<REMOVED>
Posted on 06-14-2018 12:09 AM
Not sure if this will help.
I done some testing with Unity2018.1.2f1 (with an educational license) As described by the user "Look" above, if you attempt an install it (I generally specify an external USB drive as the destination) and while it is downloading the pkg files to the downloads folder, copy them out to an alternative location, then kill the installation. Once you have have obtained all packages, i then use a program called packages, add them to the destination of /private/tmp/, then run a post script to install the packages.
for example:
#!/bin/sh
installer -pkg /private/tmp/Unity.pkg -target /
installer -pkg /private/tmp/StandardAssets.pkg -target /
installer -pkg /private/tmp/1.pkg -target /
installer -pkg /private/tmp/2.pkg -target /
installer -pkg /private/tmp/UnitySetup-Windows-Mono-Support-for-Editor-2018.1.2f1.pkg -target /
installer -pkg /private/tmp/Documentation.pkg -target /
rm -rf /private/tmp/Unity.pkg
rm -rf /private/tmp/StandardAssets.pkg
rm -rf /private/tmp/1.pkg
rm -rf /private/tmp/2.pkg
rm -rf /private/tmp/UnitySetup-Windows-Mono-Support-for-Editor-2018.1.2f1.pkg
rm -rf /private/tmp/Documentation.pkg
I then create a seperate package which just has the one post-install script which contains the following:
#!/bin/sh
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -serial E3-XXXX-XXXX-XXXX-XXXX-XXXX -username 'your-username@mail.com' -password 'password' || :
Bring both packages into JAMF, with the first package set at a priority of 10, and the licensing part with a priority of 11, throw it into a policy and point it at a group of computers that dont have unity installed.
if you run the command above using ARD, it generally returns a null error, hence i have thrown in the "|| :" at the end so that it returns true anyway. If you run this from JAMF (even without a user logged in at the time), it will create the Unity_lic.ulf file in /Library/Application Support/Unity.
One thing i noticed, If you have the machine bound to AD and a standard network user were to log on and launch Unity, they then become the owner of the Unity_lic.ulf file above, so in theory, they can delete this license file without being prompted for admin credentials. If they do, then the next user that logs in wont be able to launch Unity until it is activated again, so you may want to copy the .ulf file somewhere else when it is created and then script it so it is copied back to its original location upon logout. Havent tested that bit yet!!
Posted on 03-27-2019 07:46 AM
Just a follow up on this as it may be helpful to some...
I had an error with this on machines I was imaging and despite the install working without issue, they would not license.
It appears the 2018 version when opened created an empty license file in /Library/Application Support/Unity - I just had to add a line in the batch file to license to remove this file - and it all worked.
Posted on 07-16-2019 11:41 AM
I have been testing the latest update to Unity (2019.1.10) that apparently needs the Unity Hub to function. I was able to script the removal of all the old settings and files and package and install the new Unity Hub correctly. Where I am having issues is with licensing. As @RussellCollis mentioned above, it doesn't appear that Unity Hub uses the same licensing structure as the older version did before.
Has anyone been able to get Unity 2019.1.10 (in Unity Hub) running with a personal license? I'm aiming for students to be able to skip logging in and just create projects like they used be able to in previous versions.
Posted on 08-13-2019 04:16 AM
Hi @kricotta do you have copy of the removal script for the old unity settings? Also im working on a new package for 2019.2.0f1 which is appearing to work....
I run the normal install of unity via
#!/bin/bash
for Unity_PKG in $(awk -F"/" '/url=/ {print $NF}' < /private/tmp/UnityPackages/install.ini); do
installer -pkg "/private/tmp/UnityPackages/$Unity_PKG" -target /
done
Then include the unity app within the package just putting it into applications as normal - then using a second pkg to license the app - this was done with educational, but did seem to work in testing..
#!/bin/bash
/Applications/Unity/Unity.app/Contents/MacOS/Unity -batchmode -quit -serial 123-456-789-0 -username 'user@name.uk' -password 'password' || :1
How have you got on?
Posted on 08-13-2019 04:35 AM
ah!! I have been going back and forth with support trying to figure out the licensing! I installed all the apps using Unity Hub...In the past I would use Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -serial xx-xxxx-xxxx-xxxx-xxxx-xxxx -username 'software@quinnipiac.edu' -password 'password!'
That def doesn't seem to work anymore when I run that command in terminal I just get not such file or directory...support just keeps hitting me with the canned responses referring to the documentation out there already. I will let you know if they give me anything more. We are using an EDU license but still running into the same issues!
Posted on 08-14-2019 04:32 AM
So here was my response from Unity
Hello Stephanie
Thank you for reaching us, hope you are having a good day.
I apologize.
This process only works for Unity version 2018 and all previous versions, after deleting the Unity hub you´ll be able to make a command line activation
This is the folder you´ll need to delete
C:Users<user>AppDataRoamingUnityHublogs folder
For 2019 versions, command line activation is not available, you´ll need to do a manual activation on each computer.
You can see the steps on this link
https://docs.unity3d.com/Manual/ManualActivationGuide.html
Posted on 08-22-2019 01:33 PM
What...did I just read that for the 2019 version we'll have manually activate each machine? Oh geez...
Posted on 08-22-2019 02:22 PM
mgshepherd, I just completed a remote installation that was successful in my test environment. I'm working on documentation and will share once I have it all worked out.
Posted on 09-03-2019 08:39 AM
They appear to have pulled a blinder with this software now because of the stupid Unity Hub that wasn't on there before.
Even if you manage to activate it (whic I have a working automated method for) it then creates the licence file as that user with other users only having read access to it. If you then set 777 on this file and login with a different user it deletes the file and then creates a new one again with ownership set to that user and everyone else read only. The knock on effect of this is that every other user will get a box come up asking for administrator permissions to change Unity Hub when they open Unity.
The file is /Library/Application Support/Unity/Unity_lic.ulf
Posted on 09-03-2019 09:23 PM
depending on your licensing we run this:
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -nographics -serial -username ‘’ -password ‘*’ || :
this seems to fail using jamf remote but works fine using Apple Remote Desktop
this will license all users for Unity for the device...... its been a while since we have done it but I am sure this what we did ;)
Posted on 09-04-2019 12:53 AM
@BOBW The licensing side works fine, the issue seems to be the ownership of the lic file. Unity 2018 was fine but 2019 needs the Unity hub part and that seems to cause complications.
Posted on 09-04-2019 02:50 AM
Looking into this a bit further and I can't figure out the issue. The lic file gets its ownership changed successfully but each user still gets the "Unity Hub wants to make changes" popup asking for an admin password. I can't figure out what it's trying to change as I've given both the Unity and Unity Hub apps full permissions for all users.
Posted on 09-04-2019 04:12 AM
I think I've got this all working by using the Outset tool to run a script on each login (privileged) that does a chmod 777 on the "/Library/Application Support/Unity/Unity_lic.ulf" file. This then allows teh next user to launch it without getting a prompt for admin password.
I also added the -nographics onto the activation command which seems to them make it work properly when using Jamf Remote etc.
Posted on 01-10-2020 06:23 AM
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:
Incredibly frustrating. So I created a script that will:
* 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.
Posted on 07-21-2020 11:27 AM
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.
Posted on 10-27-2022 07:01 AM
So in a edu lab setting would it make sense to get the students to just sign in via the Unity Hub?