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

5 views (last 30 days)
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 Comments
Dorian Bovagne
Dorian Bovagne on 3 May 2018
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 on 8 Mar 2019
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.

Sign in to comment.

Answers (3)

Sean de Wolski
Sean de Wolski on 11 Aug 2014
Did you select it as a file to be installed with your application?
  3 Comments
Sean de Wolski
Sean de Wolski on 11 Aug 2014
Perhaps you need to use the full file path to the file
filepath = fullfile(ctfroot,'icon.png')
Or similar.
KAE
KAE on 14 Jul 2017
Edited: KAE on 14 Jul 2017
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.

Sign in to comment.


mohammad ibrahim
mohammad ibrahim on 21 Feb 2020
hello
I am facing the same issue. did anyone arrived to solve this please ?
many thanks

Marc Elpel
Marc Elpel on 21 Oct 2020
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 Comments
keldstefan
keldstefan on 28 Jun 2021
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 on 30 Jun 2022
is there a way to get rid of the option to creat a shortcut on the desktop wheninstalling the exe to prevent this?

Sign in to comment.

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!