Standalone Application Shortcut Issue (File Does Not Exist, Matlab Compiler 2013b)

조회 수: 8 (최근 30일)
Paul
Paul 2014년 8월 11일
댓글: Eleanor Betton 2022년 6월 30일
I have compiled an application that works perfectly when executed in Matlab.
After the installation, an error occur if I try to execute my application with the shortcuts automatically created : "File "icon.png" doest not exist. Error in main_file.m at line 42."
However, "icon.png" is existing in my installation folder.
To fix this problem, I tried executing the application directly from the installation folder without using a shortcut and it worked normally. Moreover, if I create manually a shortcut from there it works too.
The only difference in the shortcuts properties is the "Start In" property that is empty with the automatically generated shortcut and filled with my installation folder in the manual shortcut.
Is there a way to fix my application setup for further deployment on other computers ?
  댓글 수: 4
Dorian Bovagne
Dorian Bovagne 2018년 5월 3일
Hello,
This should come from the fact that you added a shortcut on the desktp during the installation. Then, the app search for your image in the same place that is your shortcut (so on your desktop). I did not figure out how to solve it while creating the shortcut on the desktop during the installation. However, if you do not create it and that you just create a shortcut while using your installation folder --> application --> and then send your app to the desktop, it should work.
If anyone has the solution to make it work directly with the shortcut from the installation, I'll take it.
Ethan Catherman
Ethan Catherman 2019년 3월 8일
I am also having this issue. In addition for me when the program saves files it sticks them next to the shortcut instead of where the program is installed.
This causes the program to error if I use the start menu shortcut since that is in a resticted location on Windows.

댓글을 달려면 로그인하십시오.

답변 (3개)

Sean de Wolski
Sean de Wolski 2014년 8월 11일
Did you select it as a file to be installed with your application?
  댓글 수: 3
Sean de Wolski
Sean de Wolski 2014년 8월 11일
Perhaps you need to use the full file path to the file
filepath = fullfile(ctfroot,'icon.png')
Or similar.
KAE
KAE 2017년 7월 14일
편집: KAE 2017년 7월 14일
I am having the same problem. I put the full path to the file in my program. I also added it to "files installed for your end user" and "files required for your application to run" in the Application Compiler. I continue to get the error 'File "c:\<username>\Matlab_programs\someFile.tif' does not exist. The directory c:\<username>\Matlab_programs\ is never mentioned in my code, so I am unclear why Matlab expects it to be there.

댓글을 달려면 로그인하십시오.


mohammad ibrahim
mohammad ibrahim 2020년 2월 21일
hello
I am facing the same issue. did anyone arrived to solve this please ?
many thanks

Marc Elpel
Marc Elpel 2020년 10월 21일
Looks like an old thread but I had the same issue and have a work around only so far.
The problem comes from the automatically generated shortcuts. The shortcuts have two paths included, one for "Target" (the application), another for "Start In". For the auto-generated shortcuts on the desktop the "Start In" is set to the desktop rather than the application location... this causes my app to crash. When you launch the application by double-clicking the app itself you start the application in the folder with the executable.
Note: The line that crashes is located in the main function call into GUI app where teh code is labeled as "DO NOT EDIT" above and below; the specific line calls gui_mainfcn().
As a temporary workaround you can deselect (or delete) the auto-generated shortcuts, then manually create them after the application is installed. To create these navigate to the application folder, right click the app, and create shortcut. The shortcut can then be moved to the desktop and will work as intended.
BTW - The same error message is raised when launching the app via the Windows 10 Start Menu. Still looking into whether there is a work around for this as well (other than not using/referring to the desktop shortcut only).
  댓글 수: 2
keldstefan
keldstefan 2021년 6월 28일
We are getting the same error when running on a VM, even if we directly double-click on the executable. Works fine from laptop. Following with great interest.
Eleanor Betton
Eleanor Betton 2022년 6월 30일
is there a way to get rid of the option to creat a shortcut on the desktop wheninstalling the exe to prevent this?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile 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!

Translated by