Changing the location of unpacking for deployed application

14 views (last 30 days)
Typically, the deployed application is unpacked in a directory named "application-name"_mcr in the directory where the deployed application .exe resides (at least on Windows platform, which is my use case). Hence the requirement for write permission to that directory (see MATLAB compiler documentation). But I would like to change it to somewhere else (like system tmp).
Googling for that I came across the option to use MCR_CACHE_ROOT environment variable (on undocumented MATLAB site) to specify the unpacking directory. But in MATLAB 2014a (which is the revision I use), that option seems to have been deprecated. Earlier versions of MATLAB used to document that environment variable, but in the newer versions, that information is gone from the documentation too.
So is there a way to change the unpacking location for the packaged standalone applications in the newer MATLAB (version 2014a or newer)?

Answers (1)

Harsha Medikonda
Harsha Medikonda on 21 Aug 2015
I understand that you wish to change the default directory where the CTF archive is extracted.
"MCR_CACHE_ROOT" is not deprecated in MATLAB R2014a or above. Refer to the following documentation link
You can use "setenv" function in MATLAB to set the "MCR_CACHE_ROOT" to the new location. Also, make sure that the environment variable is set using the "getenv" function. Refer to the following documentation links for its usage.
  1 Comment
Nasser Hosseini
Nasser Hosseini on 2 Apr 2019
I'm using MATLAB 2014b in Windows 10 envirornment. The defult directory where the CTF archive is extracted is not changed, whatever method I use, i.e. using setenv or setting the environment variable in Windows. The CTF archive is still extracted in the same directory where the .exe and .ctf files are!
Do you have any explanation? Any other suggestions for speeding up the startup of the stand-alone MATLAB applications?

Sign in to comment.

Categories

Find more on Application Deployment 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!