Dennis Hoer
Dennis Hoer

Reputation: 3779

MatLab silent install activation of network license fails

I'm trying to silent install matlab on a windows machine with a matlab network license file. The install goes ok, but the activation doesn't work. When starting matlab, it either doesn't start or I get prompted to enter a user id.

I tried adding activationPropertiesFile=C:\activate.ini to installer_input.txt and had multiple configurations of activate.ini which included activateDcAnon and activateOffline, but no luck.

The error logs do not help either:

(Jul 13, 2020 22:58:38)Starting activation process.
(Jul 13, 2020 22:58:38)Performing silent activation.
(Jul 13, 2020 22:58:39)Activating offline
(Jul 13, 2020 22:58:39)Installing license file
(Jul 13, 2020 22:58:39)Silent activation failed. Please see C:\Users\matlab\AppData\Local\Temp\aws_matlab.log for more information.

I looked at the following MatLab Answer, but it didn't help:

I can run the activation manually. I select online install, point to the license file, and click activate and matlab starts. But this is not a solution for automating cloud environments.

Upvotes: 2

Views: 1396

Answers (1)

Dennis Hoer
Dennis Hoer

Reputation: 3779

The issue was I had set enableLNU=yes in installer_input.txt. Setting it to enableLNU=no fixed the issue.

Here is an example of creating a installer_input.txt file:

@"
fileInstallationKey=9999-9999-9999-9999
agreeToLicense=yes
mode=silent
licensePath=$MATLAB_DIR\network.lic
desktopShortcut=true
startMenuShortcut=true
enableLNU=no
"@ | Out-File -Encoding Ascii -FilePath $MATLAB_DIR\installer_input.txt

Note that powershell Here-String @".."@ is encoded with UTF-16. This causes an issue with matlab installer. Pipe Here-String to Out-File to convert to ascii when writing to a file.

Now call matlab installer passing in the inputFile and force wait until installer finishes by using &... | Out-Null syntax:

&$MATLAB_DIR\MathWorks\R20XXx\bin\win64\setup.exe -inputFile $MATLAB_DIR\installer_input.txt | Out-Null

The solution is to delete the `license_info.xml` file generated during silent install:
Remove-Item -Path "C:\PROGRA~1\MATLAB\R20XXx\licenses\license_info.xml" -Force

Where R20XXx is the version of matlab you installed.

Upvotes: 3

Related Questions