Starting a deployed app through the installer shortcut uses the shortcut directory as workspace instead of the executables directory.
5 views (last 30 days)
Show older comments
Christian Hermann
on 17 May 2023
Commented: Christian Hermann
on 21 Aug 2023
Hi,
I am trying to read in some data on startup in my compiled app. I am using
[~, result] = system('set PATH');
appDir = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));
to get the directory of the app. This works fine if I start the app through the executable.
But it doesnt work when I start the app via the shortcut.
Does anybody have an idea how to fix this behaviour?
Thanks!
0 Comments
Accepted Answer
Manoj Mirge
on 18 Aug 2023
I understand that you have installed the MATLAB compiled app and while installing the app you have created the shortcut of the app on desktop. The executable when opened from the shortcut runs in a different path than when opened from folder.
The executable’s shortcut which is created while installing the executable will always execute from the directory in which the shortcut is stored. In most cases the shortcut is stored on desktop and hence the executable opens from desktop directory.
I could not find the workaround to change these behaviors of shortcut of the executable.
However, if your workflow permits, you may create the shortcut of executable manually instead of creating the shortcut while installing the executable. And then manually move the shortcut to the desktop. This shortcut would run from the directory in which the executable is installed.
To create the shortcut of the executable manually, you may select the executable file from folder and right click on mouse and in the options select “create shortcut” option. Then manually move the shortcut file to the desktop.
I hope this helps.
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing 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!