.exe included during compiling is missing

4 vues (au cours des 30 derniers jours)
Neuroesc
Neuroesc le 12 Déc 2024
Commenté : Neuroesc le 13 Déc 2024
I created a Matlab app that uses a program called analysis.exe.
I compiled my app into a standalone .exe and I included analysis.exe as a file "required for your application to run" when using deploytool.
When the compiled app is running I use ctfroot to get the filepath of analysis.exe. However, when I try to run analysis.exe at the location specified by ctfroot matlab returns an error message:
'"C:\Users\username\AppData\Local\Temp\username\mcrCache24.1\app_4\analysis.exe"' is not recognized as an internal or external command, operable program or batch file
When I go to check the location analysis.exe is not there... so it seems like analysis.exe was not included properly during compiling? Or is not extracted properly to the hidden installation folder?
Any idea what the issue is here?

Réponse acceptée

Matt J
Matt J le 12 Déc 2024
Modifié(e) : Matt J le 12 Déc 2024
I would guess, based on your other posts, that it was unpacked in a subfolder of ctfroot. That could have occurred if you directed deploytool to look for analyses.exe in a subfolder during the packaging process. Similar to a .zip, the ctfroot will recreate the same relative file and folder structure as used during packaging.
  1 commentaire
Neuroesc
Neuroesc le 13 Déc 2024 à 9:59
Thanks, this is helpful. I didn't realise it would be unpacked like that, but I guess it makes sense to avoid file conflicts etc.
I know that there will only be one copy of analysis.exe, and using ctfroot I know where to look for it, so I use this piece of code to find its exact location, in case this is useful for anybody:
% Find analysis.exe
if isdeployed % if the app has been deployed/compiled
filelist = dir(fullfile(ctfroot, '**\*analysis*')); % look in ctfroot for any copies of analysis.exe in any subdirectory
filelist = filelist(~[filelist.isdir]); % remove directories
analysis_path = [filelist(1).folder '\' filelist(1).name]; % take the first one (I know I only have one copy but this might need some thought for other people)
else % if the app has not yet been deployed
analysis_path = which('analysis.exe'); % get path of analysis.exe which is on Matlab path, this could also just be a full file path if you know it
end

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Application Deployment dans Help Center et File Exchange

Produits


Version

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by