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

7 次查看(过去 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 个评论
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