How To Install Matlab R2020a Silently

saltevog
New Contributor II

Is it possible to Install Matlab R2020a silently? I have a registration key and a license.dat File.

11 REPLIES 11

unknown_err
New Contributor III

Yes, you'll need to use the "download without installing" option in the installer app to download all the files to a Mac, then repackage it for deployment with the key, license, and edited installer_input.txt file (this file is in the downloaded files from Mathworks). I do this and make it a Self Service policy. These are the main steps I take when I'm packaging any new version.

  1. Download DMG from mathworks.com
  2. Mount DMG and run installer
  3. Click Advanced Options
  4. Select "I want to do a standard install"
  5. Log in with mathwork account
  6. Click Advanced Options
  7. Select "I want to download without installing"
  8. Once all files are downloaded, edit “installer_input.txt” with FIK, path to license.dat.
  9. Build with Packages to place the license.dat file in /Applications/MATLAB_R2020.app/licenses/ and put the contents of the downloaded Matlab folder into the "Additional Resources" of the Packages project.
  10. Use post flight script to run installer using the installer_input.txt (that command is below) plus any other customizations like preference file or certs.
    "$INSTALL_DIR"/install -inputFile "$INSTALL_DIR"/installer_input.txt

saltevog
New Contributor II

7bf1ec289b804ee79da5c4e834902d63
Thank you for your Answer. But I don't unsterstand the step 9 - 10. In Step 8 I edit the installer_input.txt:
destinationFolder=/Applications
fileInstallationKey=1234-1234-1234-1234-1234
agreeToLicense=yes
licensePath=./license/license.dat

I create a Folder in /Downloads/Matlab/license and copy my license.dat file in the folder.

That is what I do, can you explain the step 9 and 10. On the attachment, you can see my Folder Matlab in Downloads.

You say in Step 9:

Build with Packages to place the license.dat file in /Applications/MATLAB_R2020.app/licenses/ and put the contents of the downloaded Matlab folder into the "Additional Resources" of the Packages project.

I don`t have a Matlab folder in Applications.

unknown_err
New Contributor III

I use the Packages app to repackage the Matlab software. If you use something else your workflow will be a little different, but the end result should be the same. I can give more detail about how I do it in Packages though if that helps. The main thing is to put the license file in the right file path and to place those downloaded files somewhere on the Mac and then trigger the install from that directory. I use Packages to do this because it creates a temporary directory for those files and I don't have to worry about it.

More details about doing this in Packages,
In the Payload tab of Packages, I add the folders where the app will be installed. The license.dat file needs to be in /Applications/MATLAB_R2020.app/licenses/, so I create that location and place the file there. Then, I put all those files that were downloaded (that are currently in the downloads folder) and drag them into the Additional Resources section of the Scripts tab in the Packages. Then I use a postflight script to set the directory and install matlab using those files (those commands are below, I can't share the whole script because of other customizations we do).

INSTALL_DIR="$(dirname $0)"
"$INSTALL_DIR"/install -inputFile "$INSTALL_DIR"/installer_input.txt

6f8cb25224cf4597b4121f8e32023121

8fc8395620f54b00b20a76ef7564facc

saltevog
New Contributor II

Thank you, it works fine.

winterboer
New Contributor III

@unknown_err Thank you for this, I've built a package such as this using Packages but I'm getting an error message which I think its due to the postflight script.

Do I need to do any modifications to these lines for the postflight.sh?

INSTALL_DIR="$(dirname $0)"
"$INSTALL_DIR"/install -inputFile "$INSTALL_DIR"/installer_input.txt

unknown_err
New Contributor III

@winterboer You shouldn't need to unless the installer_input.txt file was renamed.

winterboer
New Contributor III

@unknown_err made zero changes to file names.

Do I need to modify the syntax for my own environment?

unknown_err
New Contributor III

@winterboer Not for the file names or the postflight, you should be able to keep it as is. What error are you seeing? The only things you'd need to modify with this workflow would be the contents of the installer_input.txt file and the license file unless you have other modifications to make.

jchen1225
New Contributor III

Thank you @unknown_err , I am also trying to make this work. I am not sure if something is wrong with my postflight script, but it should work as is right?

1cd462a4976643de8ddde7b8e27cd2dc

unknown_err
New Contributor III

@jchen1225 Yes, it should work as is for the workflow using the Packages app or as long as the postflight script is in the same directory as the installer_input.txt file and the other Matlab installer files.

jchen1225
New Contributor III

Thanks @unknown_err , it works great with R2021a as well.