Repackaging Matlab 2011b with Composer
Since starting to use Casper at my workplace, I’ve wanted to be able to provide a unlicensed Matlab installer via Self Service. The reason I wanted it unlicensed is because, while we have a Matlab network license server, it has a very limited license pool. Instead, most of our labs purchase standalone licenses and register them to the person using it.
However, a showstopper issue I’ve run into has been that Matlab needs to have a license entered as part of the installation process. After some trial and error, I was able to figure out a way to use Jamf Software’s Composer build a Self Service-deployable installer that uses our network license and also an unlicensed installer. See below the jump for the details.
Building the Matlab network license installer with Composer
1. Find and launch the installer files for the version you require (in this case, I’m building a Matlab 2011b installer.)
2. Copy the installer directory to your desktop before running the installer.
3. Launch Jamf Software’s Composer and have it take a snapshot for packaging.
4. Launch the installer and use the Install without using the internet option.
5. Accept the End User License.
6. Enter the File Installation Key (FIK) for the version you wish to install (some information has been redacted.)
7. Specify the installation type (I chose Typical)
8. Specify the installation folder path (I chose /Applications.)
9. Download and save the license.dat file for the Matlab network license to your desktop.
10. Direct the installer to this file’s location when requested.
11. Proceed with the installation.
When completed, Matlab should be set to run using the license on the server.
12. Open Terminal and run the following commands:
sudo chown -R root:admin /path/to/MATLAB_RXXXXX.app
sudo chmod -R ug+rwx /path/to/MATLAB_RXXXXX.app
(MATLAB_RXXXXX is your Matlab application. Fill in as appropriate.)
This will fix the permissions of the Matlab application, from being owned by the user account that installed it to now being owned by the root user and admin group. This allows multiple accounts on the box to use Matlab successfully.
13. Go back to Composer and have it finish the snapshot process.
14. When the snapshot process finishes, delete the Users directory. The only directory that should be listed is Applications, with MATLAB_RXXXXX.app inside
15. Composer will then give the option of saving the installer package as a Casper-usable .dmg installer or as a standard Apple .pkg installer.
Removing the network license to force Matlab to prompt for activation
1. Log in with an account that has administrator privileges.
2. Open Terminal and run the following command to delete the Matlab network license file:
sudo rm /path/to/MATLAB_RXXXXX.app/licenses/*.lic
(MATLAB_RXXXXX is your MatLab version)
3. Close out of Terminal.
4. Open Matlab. You should be prompted to activate a new license.
5. Quit out of Matlab.
At this point, you should be able to repackage the Matlab application again to build an unlicensed installer that can be deployed via Casper or your other deployment tools.
Thank you for these extremely useful instructions! Are they still relevant for R2015A or R2015B?