Starting a deployed app through the installer shortcut uses the shortcut directory as workspace instead of the executables directory.
6 ビュー (過去 30 日間)
古いコメントを表示
Christian Hermann
2023 年 5 月 17 日
コメント済み: Christian Hermann
2023 年 8 月 21 日
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 件のコメント
採用された回答
Manoj Mirge
2023 年 8 月 18 日
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.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!