MATLAB: Matlab Compiler – extrafiles – any change in Standalone creation behaviour

configuration filesMATLAB Compiler

Matlab R2014a:
I use a configuration text file to allow user of the exe file to change some parameters. That text file is stored in the same folder as main *.m program file. I call it from main program with following line:
[fid,errmsg]=fopen('Chemins.txt');
When compiling it, I just have to add the text file manually into "Files installed into your application"
It works just fine
Matlab R2016b:
Same files, but at compiling, the text file is inserted automatically in "Files required for your application to run".No way to remove it… Parameters set in that file at compilation are then considered by the exe application as hard-coded. Any change made to text file on the client computer is not taken into consideration…
Question: How to add a configuration text file for an end-user with Matlab R2016b compiler ?
Thanks in advance Luis

Best Answer

Eventually found out the answer. By adding current working directory when opening the file:
[fid,errmsg]=fopen([pwd '\Chemins.txt']);
That way, deploytool does not insert automatically the configuration text file into "Files required for your application to run"
That means that, between R2014a and R2016b, behaviour of compilation tools has changed...
BTW, the use of MCC command also allows to fix the issue with original version of code
Related Question