[Guide] How to Deploy Matlab 2017a

We spent about a week working with Mathworks support and PDQ support to figure this out and they requested that I post my results here in case others have the same issue.

We specifically worked with Matlab 2017a in this case but I assume that it would work with other versions as well.

The first issue that we ran into was that the installer files were distributed to us as two ISO's. Our lab admins were manually mounting each ISO, one at a time, on each machine in order to install the software. Luckily, Mathworks provides documentation on how to merge the two ISO's into one installer package: https://www.mathworks.com/matlabcentral/answers/320198-how-can-i-obtain-a-single-installation-package-for-matlab-with-the-isos-merge-the-iso-images

Once you have done this, put the installer package up on your PDQ Deploy repository. This guide assumes that you have a network file share set up for this purpose or at least you know how to set that up. If you don't have one and don't know how then you should check out PDQ's youtube channel. It's a great resource and they have videos that can help teach you how to do that: https://www.youtube.com/user/AdminArsenal
After that you will need to create an installer_input.txt file. There should already be a Mathworks-provided example installer_input.txt file in your installer package. I recommend that you save that one for future reference and copy it to create your version. Here are the options that we uncommented and set but your experience may differ:

destinationFolder=C:\Program Files\MATLAB\R2017a
licensePath=\\server\share\Matlab\Matlab 2017a\MatlabLicense.lic

A few additional notes on the installer_input.txt file-- we always leave all of the products at the bottom commented out. The installer defaults to installing all of your licensed products-- if you start manually defining packages then it could install products that you are not licensed for or it could omit packages that you are licensed for. You don't want either of those things to happen. We have a FlexLM license server for Matlab but for some reason the installer still wants our license file. I'm assuming that it uses it to determine which features you are licensed for but I'm not sure. Make sure you use a UNC path to point to your license file. Put the license file in the root of your Matlab installer folder (the same folder where setup.exe is)

Now for the actual PDQ package. We did a separate package to uninstall Matlab 2016a and then embedded it into our installer package as a nested package as the last step. We used to have it as the first step during testing but our file server rebooted in the middle of a Matlab 2017a deployment, having already uninstalled Matlab 2016a from a bunch of machines. You can side-install different versions of Matlab without issue so it's safer to save the uninstall step for last. That way the worst-case scenario is that Matlab 2016a is still there and Matlab 2017a is only halfway there, so at least the workstation has one working version of Matlab.

For our next step we have a command step that sets an environmental variable so Matlab knows where our license server is. The command is:
setx MLM_LICENSE_FILE port@server.domain /m

For our next step we are not going to do an install step; we are going to do a command step instead. The installer step was fraught with issues because the setup.exe passes off the installation to /bin/win64/setup.exe. That causes PDQ Deploy to think the deployment is finished and begin cleaning up the files. That will result in a "file not found" error in the Matlab installer log file, and the installation will fail. Thus, a command step:

\\server\share\PDQ_Deploy_Repo\Matlab\2017a\bin\win64\setup.exe -inputFile \\server\share\PDQ_Deploy_Repo\Matlab\2017a\installer_input.txt

Make sure to point at the \bin\win64\setup.exe and not the setup.exe in the root of the folder. I don't know why it works, but it does.

The last step is a reboot step.

For all of our steps, we set the following conditions:
O/S Architecture: 64-bit
Logged On State: Only run if no user is logged on

And that's it! This package (including uninstall) takes ~12 minutes in my testing VM (very fast, SSD) and ~30 minutes on our slowest lab machines (Core2Duo, Windows 7x64, 4GB of RAM).



Date Votes
  • Tried all of the above and no matter what I cannot get that to deploy without error 1 or not at all.  I can logon to the PC remotely and run exactly the same installation command and works fine as long as I don't select silent install.  Frustrating but heck I still like this guide as it pointed me in the right direction for lots of other steps of MATLAB I wasn't familiar with.

  • Arrrrgh it was something so simple I placed exclamation marks in the licence path as the path had a space in it so thought it would need it.  When I placed in automated instead of silent I was able to identify the marks where in the path so then removed them and worked fine.  I wonder if that job in Mc Donalds is still available :-)


  • No worries, glad you got it sorted out.

    Be careful about the server that hosts your PDQ repository rebooting because that will break any active Matlab installs halfway through. We have run into this once or twice while trying to push an automated PDQ deployment during our file server's weekly reboot window.

  • I don't get how you are doing this. The command step enters commands line by line in cmd. Cmd does not support UNC path. What am I missing here?

  • Priyam,

    Are you having an actual issue with the implementation of this package or is your question purely theoretical?

    You say that CMD does not support UNC paths but I have no issues calling an executable from within CMD from a UNC path.

    You might be referring to the fact that CMD does not support UNC paths as the starting directory or as the current directory? As in you cannot CD to a UNC path directly:

    C:\Windows>cd \\server\share
    CMD does not support UNC paths as current directories.

    While it is true that CMD will not allow you to CD to a UNC path you can still call an executable that is within a UNC path as long as you do not try to CD to it first. In this example I have placed a simple whois query executable in a share on my server and called it from CMD:

    C:\Windows>\\server.test\home\lnichols\whois.exe pdq.com

    Whois v1.20 - Domain information lookup
    Copyright (C) 2005-2017 Mark Russinovich
    Sysinternals - www.sysinternals.com

    Connecting to COM.whois-servers.net...

    WHOIS Server: whois.godaddy.com
       Registrar URL: http://www.godaddy.com
       Updated Date: 2016-12-20T13:37:52Z
       Creation Date: 1994-05-24T04:00:00Z
       Registry Expiry Date: 2023-05-23T04:00:00Z
       Registrar: GoDaddy.com, LLC
       Registrar IANA ID: 146
       Registrar Abuse Contact Email: abuse@godaddy.com
       Registrar Abuse Contact Phone: 480-624-2505
       Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
       Domain Status: clientRenewProhibited https://icann.org/epp#clientRenewProhibited
       Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
       Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
       Name Server: NS47.DOMAINCONTROL.COM
       Name Server: NS48.DOMAINCONTROL.COM
       DNSSEC: unsigned
       URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
    >>> Last update of whois database: 2018-03-06T17:49:49Z <<<

  • Hi Luke,


    Thanks for the response! I am not sure what I was doing but I deleted and created the package and again and it all worked. 







Please sign in to leave a comment.

Didn't find what you were looking for?

New post