Installing MATALB R2022a via Self Service

greenet3
New Contributor II

Hey everyone, 

Before I get started, I just want to say that I am taking over our macOS environment as a primary Windows admin. With that said, I have pretty good knowledge about JAMF and the macOS ecosystem. 

Now that we have that cleared up, any help going forward, I truly appreciate it. 

Whenever I had to deploy software in the past, I would use the free Packages app from WhiteBox by installing my application as is, and then simply dragging the .app file from /Applications to the Packages icon in the dock. From there, Packages would create the .pkg file, and I upload that file via JAMF admin to create a policy in JAMF Pro. Pretty straightforward. 

We are getting ready to deploy MATLAB, and we've done the same thing for 2020 and 2021. However, for 2022, that process is not working. I have the full 12GB .dmg installer. I install MATLAB using their native GUI, enter in my FIK,  select all of the toolboxes, and then install it. The final .app file size is 22GB. I tried to drag that over the Packages icon, but it gave me an "X." I then decided to use Composer. I dragged the .app over to a sources section, and I try to build the .pkg. Success! But wait, when I run the .pkg manually, I get that This package is incompatible with this version of macOS. Granted I am installing this on the same machine where I used the native MATLAB installer. I also saw that it is trying to install content to the system volume. But I'm not sure how that is the case where the root folder is /Applications. 

I know there is an option with the installer_input.txt (similar to how Windows works) but is that possible using Self Service? I reached out to MATLAB support, and they recommended using the silent file, but not sure if that is feasible with Self Service. Again any help is truly appreciated. 

1 ACCEPTED SOLUTION

Qwheel
Contributor II

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.

View solution in original post

4 REPLIES 4

Qwheel
Contributor II

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.

greenet3
New Contributor II

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.

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!