I package this up yearly. Mathworks could do a better job with their documentation IMO.
I download the current Matlab DMG from their site.
Throw its contents into /var/tmp.
Chuck that file into Composer to make a PKG to be uploaded to JAMF.
Going back to /var/tmp, I then locate the 'installer input file' and duplicate two copies out and dump them adjacent to the installer.
Using a text editor, I go through and uncomment the relavant sections and fill in the required information. These both go into Composer as a second PKG and get uploaded to JAMF.
In JAMF I create a policy that has both PKGs, and a script that looks like this:
sudo rm -R /Applications/MATLAB_R2021a.app
sudo rm -R /Applications/MATLAB_R2021b.app
sudo rm -R /Applications/MATLAB_R2022a.app
sudo /private/var/tmp/R2022a/install -inputFile /private/var/tmp/installer_input_R2022a_student2.txt
sudo rm -R /private/var/tmp/R2022a
sudo rm /private/var/tmp/installer_input_R2022a_student2.txt
sudo rm /private/var/tmp/installer_input_R2022a_staff2.txt
exit 0
There's a bit of creative license going on here but that's the long and short of it. You're essentially passing the license serial, FIK, and what components you wish to install via the 'installer input' file.
Why is there a '2' at the end, because like me, you'll wind up doing your installer input files twice at least. Reason being, you'll undoubtedly go through and uncomment every single component in the file and your installation will fail. When you run the installer, you'll want to peruse the log file that you (should have) configured in the installer input file and it'll tell you why the installation has failed.
Also, why is there two files in my PKG? This is because student devices are on campus and get licenses from a floating license server, staff devices are portable and need to work off campus (they have to go and register their username against our site license on the Mathworks website).
You don't necessarily have to test your deployment using JAMF, you can run the command in Terminal and still get the same result.
Other notes: Sometimes I've found the installer input file isn't contained in the DMG contents, for which I have gone and pinched the file from the 'Linux' download. It's the same file.
I package this up yearly. Mathworks could do a better job with their documentation IMO.
I download the current Matlab DMG from their site.
Throw its contents into /var/tmp.
Chuck that file into Composer to make a PKG to be uploaded to JAMF.
Going back to /var/tmp, I then locate the 'installer input file' and duplicate two copies out and dump them adjacent to the installer.
Using a text editor, I go through and uncomment the relavant sections and fill in the required information. These both go into Composer as a second PKG and get uploaded to JAMF.
In JAMF I create a policy that has both PKGs, and a script that looks like this:
sudo rm -R /Applications/MATLAB_R2021a.app
sudo rm -R /Applications/MATLAB_R2021b.app
sudo rm -R /Applications/MATLAB_R2022a.app
sudo /private/var/tmp/R2022a/install -inputFile /private/var/tmp/installer_input_R2022a_student2.txt
sudo rm -R /private/var/tmp/R2022a
sudo rm /private/var/tmp/installer_input_R2022a_student2.txt
sudo rm /private/var/tmp/installer_input_R2022a_staff2.txt
exit 0
There's a bit of creative license going on here but that's the long and short of it. You're essentially passing the license serial, FIK, and what components you wish to install via the 'installer input' file.
Why is there a '2' at the end, because like me, you'll wind up doing your installer input files twice at least. Reason being, you'll undoubtedly go through and uncomment every single component in the file and your installation will fail. When you run the installer, you'll want to peruse the log file that you (should have) configured in the installer input file and it'll tell you why the installation has failed.
Also, why is there two files in my PKG? This is because student devices are on campus and get licenses from a floating license server, staff devices are portable and need to work off campus (they have to go and register their username against our site license on the Mathworks website).
You don't necessarily have to test your deployment using JAMF, you can run the command in Terminal and still get the same result.
Other notes: Sometimes I've found the installer input file isn't contained in the DMG contents, for which I have gone and pinched the file from the 'Linux' download. It's the same file.
So you extract the .dmg to /var/temp, and then put the .dmg into Composer. I'm familiar with the input file since it's how we do it on Windows. We don't uncomment toolboxes as we just install everything.
The thing I am confused about is the second PKG. Is the script in the main PKG, or a second one? I guess what I don't get is using the .dmg to create a package. By default, does that just dump everything into /private/var/temp? If so, then I guess the second PKG is with the script only.
So you extract the .dmg to /var/temp, and then put the .dmg into Composer. I'm familiar with the input file since it's how we do it on Windows. We don't uncomment toolboxes as we just install everything.
The thing I am confused about is the second PKG. Is the script in the main PKG, or a second one? I guess what I don't get is using the .dmg to create a package. By default, does that just dump everything into /private/var/temp? If so, then I guess the second PKG is with the script only.
A policy on JAMF can have multiple payloads. This can be PKGs that dump files with preconfigured permissions to locations on the computer. You can also run scripts before or after the deployment of PKGs.
In my case, my policy has 2x PKGs and an ‘after’ script.
If you haven’t already, in JAMFcloud, go to Computers -> Management settings -> Scripts, to view/create scripts.
These items can be added to policies too.
the same is true for config profiles, you can add as many payloads as you wish to a single profile, although it’s not advised/bad practice.
The item inside the Matlab DMG (disk image i.e. like a windows ISO) is an installer.
Not to be confused with a DMG that has a .app program inside (Skype or something like that).
The long and short of this:
Most small apps that come in a DMG can be dumped straight into /Applications, big apps that are complicated I.e. Autodesk, Matlab, Unity. Don’t like being ‘snapshotted’ or have their permissions changed, they’re too complex.
In this case, you need to do the legwork. Get the installer onto the machine, and run a post script to trigger the installation silently.
As for /var/tmp, or the /tmp folder. Google it for proper definitions 😉 we have a hive mind at our fingertips.
In my experience, /tmp is cleared at system restart, /var/tmp is more persistent but gets cleared away during software updates.
You can use Finder and “Go to folder”, to locate the folder.
So you extract the .dmg to /var/temp, and then put the .dmg into Composer. I'm familiar with the input file since it's how we do it on Windows. We don't uncomment toolboxes as we just install everything.
The thing I am confused about is the second PKG. Is the script in the main PKG, or a second one? I guess what I don't get is using the .dmg to create a package. By default, does that just dump everything into /private/var/temp? If so, then I guess the second PKG is with the script only.
Also - I didn’t know that not uncommenting all the components, in turn installs all of the components we’re licensed for.
I’ll try that next time, cheers!