MATLAB Answers

Deployed App help files when app launched using shortcut

2 views (last 30 days)
Marc Elpel
Marc Elpel on 20 Aug 2020
I have an app that works fine within matlab, but when deployed and launched via the auto-generated shortcut the Help menus do not come up. Navigating and clicking on the acutal exe file works OK.
I believe the issue is the "start-in" directory is not set to the application directory, and therefore my help files are not found.
I've added code for this and tried a few versions, none of which currently work. The else code below handles the deployed situation. The commented out part was tried but the path returned look like it was for the runtime engine, not the app (I could be wrong - some limits on what I can test internally).
% Always execute from the Alinity folder as current path.
handles.AppPath = handles.Build.Directory;
% User is running an executable in standalone mode.
handles.AppPath = pwd;
% [status, result] = system('set PATH');
% executableFolder = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));
The code which uses the directory and is not working is included below. Ideally I could just use a relative address in the form '.\Help\HelpMenu.htm' but this failed.
fname = fullfile(handles.AppPath,'Help\HelpMenu.htm');
  1. Is there a way to do relative addressing on a deployed application for this so I do not need to get about the installed path.
  2. Is there a way to get the actual installed path to build tthe file name as above?


Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by