| MATLAB Runtime Server | ![]() |
Automatically Packaging Files for Shipping
The Runtime Server software includes a packaging utility that can automatically archive your application files and create all the executable files that your users need in order to install your application on their machines.
The packaging utility is called package and is located in the toolbox\runtime\oem directory. When you execute package, it prompts you for all necessary information. It reports all relevant information to you, including the files it creates and the instructions that you should follow in order to test the installation. These are the same instructions that end users need to follow in order to install your application. Installing and Running the Application contains more information about the installer software.
The rest of this section contains more detail for PC and UNIX versions of package.
Packaging Utility on PC
To run the automatic packaging utility on PC platforms, follow these steps:
A sample configuration file is toolbox\runtime\oem\user.config_pc.
Notice from the sample user.config_pc file that the path of each listed file
starts from toolbox (for example, toolbox\local\matlabrt.p).
If you used the buildp function to create P-code for your application, then
you can use a text editor to adapt the output variable depfunout{1} to turn
it into a valid configuration file. When you adapt the contents of
depfunout{1}, remember to change .m into .p because you have presumably
compiled each M-file into a P-file. Also remember to use the .dll extension
for MEX-files.
When preparing the configuration file, you may use * as a wildcard, # to
preface comments, and blank lines to improve readability.
package (if your application does not use Java classes)
package -java (if your application uses Java classes)
The packaging utility prompts you for:
demo_app.bat.
Alternatively, the syntaxes below eliminate the need for prompts.
package -r matlabroot -c config_file -n app_name
package -java -r matlabroot -c config_file -n app_name
The packaging utility produces a file called setup.exe in the directory from which it was launched. This is the file you should ship to end users.
Packaging Utility on UNIX
To run the automatic packaging utility on UNIX platforms, follow these steps:
A sample configuration file is toolbox/runtime/oem/user.files. When you
adapt user.files for your own application, you should preserve the lines
that package install_rt, user.install, and user.app. You may change
the part after that, using the format
name_of_source_file location_of_source_file target_location
where target_location refers to the destination directory in the end user's
installation, relative to the directory from which the user runs the installer
program.
In your configuration file, you can use $SCRIPTDIR to indicate the directory
location of the package script and $MATLAB to indicate the MATLAB root
directory. You can also use Bourne shell wildcards in filenames.
toolbox/runtime/oem/package
using the -java switch if your application uses Java classes. The script
prompts you for the MATLAB root directory, the architecture, and the name
of your configuration file.
The package script produces two files:
app.tar.files, which lists the files in the applicationapp.tar, which is a tar file made from the applicationYou should ship app.tar to end users. For more details about the UNIX packaging utility, see the README file in toolbox/runtime/oem.
| Organizing Files for Shipping | Manually Packaging Files for Shipping (PC) | ![]() |