deploytool batch file issue

7 views (last 30 days)
Tobyn VanVeghten
Tobyn VanVeghten on 26 Jun 2013
Commented: BG on 15 May 2014
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 Comments
Tobyn VanVeghten
Tobyn VanVeghten on 26 Jun 2013
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 on 26 Jun 2013
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?

Sign in to comment.

Answers (1)

Muthu Annamalai
Muthu Annamalai on 26 Jun 2013
@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 Comments
Tobyn VanVeghten
Tobyn VanVeghten on 27 Jun 2013
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 on 15 May 2014
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).

Sign in to comment.

Categories

Find more on Standalone Applications in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!