.exe included during compiling is missing

3 ビュー (過去 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 Center および File ExchangeApplication Deployment についてさらに検索

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by