.exe included during compiling is missing

26 Ansichten (letzte 30 Tage)
Neuroesc
Neuroesc am 12 Dez. 2024 um 15:40
Kommentiert: Neuroesc am 13 Dez. 2024 um 9:59
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?

Akzeptierte Antwort

Matt J
Matt J am 12 Dez. 2024 um 19:00
Bearbeitet: Matt J am 12 Dez. 2024 um 19:12
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 Kommentar
Neuroesc
Neuroesc am 13 Dez. 2024 um 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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Application Deployment finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by