deploytool batch file issue

3 次查看(过去 30 天)
Tobyn VanVeghten
Tobyn VanVeghten 2013-6-26
评论: BG 2014-5-15
I'm trying to write a simple batch file to automate building my Matlab compiled application. I'm deploying to both 32-bit and 64-bit machines. The individual commands work at the command line, but the batch file stops after the first deploytool command. Has anyone encountered this? Any idea what is going on? Here is my simple batch file:
echo off
echo Building win64 application...
deploytool -build source_win64.prj
echo Building win32 application...
deploytool -build -win32 source_win32.prj
echo Copying executables to deployment folder...
copy /y source_win64.exe D:\deployment
copy /y source_win32.exe D:\deployment
Thanks, Tobyn VanVeghten
  3 个评论
Tobyn VanVeghten
Tobyn VanVeghten 2013-6-26
No error was thrown. It simply stopped. I could tell by the time stamps that my second file hadn't been built nor had my files been copied.
I also noticed this morning that even though only one application has the -win32 command, both are being built to win32. Both versions will now run on my other machine, which shouldn't be possible...
Kaustubha Govind
Kaustubha Govind 2013-6-26
What about if you manually run the commands in sequences from the shell. Do you see any error? Is your MATLAB 64-bit or 32-bit?

请先登录,再进行评论。

回答(1 个)

Muthu Annamalai
Muthu Annamalai 2013-6-26
@Tobyn you probably want to invoke MATLAB from shell to do this right. I understand your code is executed on the windows commandline.
So you should have to write in your shell script,
matlab -r 'deploytool -build source_win64.prj; exit'
matlab -r 'deploytool -build -win32 source_win32.prj; exit'
However if your script was a MATLAB code in the 'command' mode you want to use
'copyfile' instead of 'copy'
  2 个评论
Tobyn VanVeghten
Tobyn VanVeghten 2013-6-27
I can't do it from within Matlab because the -win32 is only available from the windows commandline, not within Matlab (at least, per the deploytool help file in Matlab). If I do the above command (using double quotes rather than single quotes), deploytool runs in the background and the exit command is then immediately executed, well before deploytool finishes. Is there a way I can make deploytool run in the foreground and have the exit command truly executed after deploytool finishes?
BG
BG 2014-5-15
I don't think the deploytool's -win32 option is usable in R2014a, because the installer will not allow you to install 32-bit and 64-bit versions to the same root directory (I just tried and got an error message that it is not supported). So it is not possible to meet the requirement that "you use the same MATLAB installation root for both 32-bit and 64-bit versions of MATLAB" (from deploytool documentation).
I also would like to know if there is a way to run deploytool in the foreground. Unless that is possible, I think a fully non-interactive build script would have to call mcc directly (presumably sacrificing some of the nice features of deploytool).

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Standalone Applications 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by