Matlab stand-alone executables crash on the first launch but works after that

12 views (last 30 days)
I have made a (Windows) installer program that installs the Matlab Compiler Runtime (R2012b) and then, after restart, tries to automatically launch a Matlab stand-alone executable compiled with the same compiler version. I have administrator rights on the computer and the executable is tagged "Run as admininstrator". I have tried this installation procedure on a number of different computer platforms with the following results:
  • Win 7 and Win 10 upgraded from Win 7: The executable launces automatically at start-up without issues
  • Windows 8 and Win 10 upgraded from Win 8: The executable will most often fail to launch at the first attempt (won't start at all, no code executed) but may work the next. Once it works, it will always work.
This is obviously a problem since my customers, who use arbitrary platforms, are supposed to do this install. If the executable fails at startup, their account is not set up properly and they will not be able to run the installed software. I paid a lot for the Matlab compiler and I really think I could expect a more stable behaviour. Do I need to write something to the Windows registry beforehand, and what? Is there a command line I can add to the executable to force it to run and what should it say?
Your help is greatly apppreciated!

Answers (1)

Walter Roberson
Walter Roberson on 15 Aug 2016
That combination leads me to wonder if it is connected to .NET versions? I seem to recall that in the R2012 time frame, that .NET 3.5 and that there were sometimes problems installing on Windows 8 because .NET 4.0 would have to be removed so that the earlier .NET could be installed. (Checking references, I see that .NET 4.0 was needed if you were using SDK 7.1 but not for the other compilers.) Then Windows 10 made it worse by using .NET 4.5 and making it hard to remove that. But once somehow you had managed to install the needed .NET version then you would be fine.
The operating system requirements for programs compiled with MATLAB Compiler are the same as the MATLAB release it was compiled with. R2012a did not support Windows 10 -- Windows 8 was its limit
  1 Comment
Fredrik Gustavsson
Fredrik Gustavsson on 18 Aug 2016
Thanks. That is an interesting point. The hardware I use that works together with the executable is compatible only with .NET 4.0 and .NET 4.5 and the installer for that program installs .NET 4.0 by default if no .NET version exists on the computer. It's not trivial to verify that it is a .NET versio issue but with time I might get a better clue. I leave the question open a while longer in case someone comes up with something else as well.

Sign in to comment.


Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!