.exe included during compiling is missing

조회 수: 2 (최근 30일)
Neuroesc
Neuroesc 2024년 12월 12일
댓글: Neuroesc 2024년 12월 13일
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?

채택된 답변

Matt J
Matt J 2024년 12월 12일
편집: Matt J 2024년 12월 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
Neuroesc
Neuroesc 2024년 12월 13일
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

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by