Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path management in deployed applications #39

Open
avouros opened this issue Aug 20, 2016 · 0 comments
Open

Path management in deployed applications #39

avouros opened this issue Aug 20, 2016 · 0 comments

Comments

@avouros
Copy link
Collaborator

avouros commented Aug 20, 2016

According to the following:

  1. Path Management in Deployed Applications
  2. For stand-alone exe, how do I include a folder of files and know how to access them.
    in order to make sure that your code works both on MATLAB and the standalone app it needs to be written like:
fmt = repmat('%s ',[1,3]);
if ~isdeployed
    fileID = fopen('configs.txt');
    contents = textscan(fileID,fmt,'CollectOutput',1,'Delimiter',',');
else
    fileID = fopen(fullfile(ctfroot,'configs','configs.txt'));
    contents = textscan(fileID,fmt,'CollectOutput',1,'Delimiter',','); 
end

The code above reads a text file inside the folder 'configs' which is located inside the root folder of the project.

Unfortunately even by following the above guidelines the code still does not work on the standalone version.

The matlab fopen(fullfile(ctfroot,'configs','configs.txt')) command points to the location: C:\Users\user_name\AppData\Local\Temp\user_name\mcrCache9.0.1\mwm_ml0\configs\configs.txt
where no configs exists.
By navigating inside the folder *C:\Users\user_name\AppData\Local\Temp\user_name\mcrCache9.0.1\mwm_ml0* I noticed that the folder hierarchy of my project (and the folder configs) is actually located inside:
**C:\Users\user_name\AppData\Local\Temp\user_name\mcrCache9.0.1\mwm_ml0\Users\user_name\Documents\MATLAB\Deploy Beta Version**.

I should investigate this further. At the moment if all the files of the project are located inside the same folder and are compiled then the standalone version works like charm.

(refer also to #22)

@avouros avouros self-assigned this Aug 20, 2016
@avouros avouros added the notes label Aug 20, 2016
@avouros avouros mentioned this issue Aug 20, 2016
@avouros avouros added the bug label Aug 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants