Main Content

Customize an Application

You can customize an application in several ways: customize the installer, manage files in the project, or add a custom installer path using theApplication Compilerapp or theLibrary Compiler应用程序。

Customize the Installer

Change Application Icon

To change the default icon, click the graphic to the left of theLibrary nameorApplication namefield to preview the icon.

ClickSelect icon, and locate the graphic file to use as the application icon. Select theUse maskoption to fill any blank spaces around the icon with white or theUse borderoption to add a border around the icon.

To return to the main window, clickSave and Use.

Add Library or Application Information

You can provide further information about your application as follows:

  • Library/Application Name: The name of the installed MATLAB®artifacts. For example, if the name isfoo, the installed executable isfoo.exe, and the Windows®start menu entry isfoo. The folder created for the application isInstallRoot/foo.

    The default value is the name of the first function listed in theMain File(s)field of the app.

  • Version: The default value is 1.0.

  • Author name: Name of the developer.

  • Support email address: Email address to use for contact information.

  • Company name: The full installation path for the installed MATLAB artifacts. For example, if the company name isbar, the full installation path would beInstallRoot/bar/ApplicationName.

  • Summary: Brief summary describing the application.

  • Description: Detailed explanation about the application.

All information is optional and, unless otherwise stated, is only displayed on the first page of the installer. On Windows systems, this information is also displayed in the WindowsAdd/Remove Programscontrol panel.

Change the Splash Screen

The installer splash screen displays after the installer has started. It is displayed along with a status bar while the installer initializes.

You can change the default image by clicking theSelect custom splash screen. When the file explorer opens, locate and select a new image.

You can drag and drop a custom image onto the default splash screen.

更改安装路径

This table lists the default path the installer uses when installing the packaged binaries onto a target system.

Windows C:\Program Files\companyName\appName
Mac OS X /Applications/companyName/appName
Linux® /usr/companyName/appName

You can change the default installation path by editing theDefault installation folderfield underAdditional installer options.

A text field specifying the path appended to the root folder is your installation folder. You can pick the root folder for the application installation folder. This table lists the optional custom root folders for each platform:

Windows C:\Users\userName\AppData
Linux /usr/local

Change the Logo

The logo displays after the installer has started. It is displayed on the right side of the installer.

You change the default image inAdditional Installer Optionsby clickingSelect custom logo. When the file explorer opens, locate and select a new image. You can drag and drop a custom image onto the default logo.

Edit the Installation Notes

Installation notes are displayed once the installer has successfully installed the packaged files on the target system. You can provide useful information concerning any additional setup that is required to use the installed binaries and instructions for how to run the application.

Determine Data Type of Command-Line Input (For Packaging Standalone Applications Only)

我运行一个可执行的独立应用程序时n the command prompt, the default input type ischar. You can keep this default, or choose to interpret all inputs as numeric MATLAB doubles.

To pass inputs to the standalone application as MATLAB character vectors, selectTreat all inputs to the app as MATLAB character vectors. In this case, you must include code to convertcharto a numeric MATLAB type in the MATLAB function to be deployed as a standalone application.

To pass inputs to the standalone application as numeric MATLAB variables, selectTreat all inputs to the app as numeric MATLAB doubles. option in the Application Compiler App. Thus, you do not need to include code to convertcharto a numeric MATLAB type. Non numeric inputs to the application may result in an error.

Manage Required Files in Compiler Project

The compiler uses a dependency analysis function to automatically determine what additional MATLAB files are required for the application to package and run. These files are automatically packaged into the generated binary. The compiler does not generate any wrapper code that allows direct access to the functions defined by the required files.

If you are using one of the compiler apps, the required files discovered by the dependency analysis function are listed in theFiles required for your application to runorFiles required for your library to runfield.

To add files, click the plus button in the field, and select the file from the file explorer. To remove files, select the files, and press the删除key.

Caution

Removing files from the list of required files may cause your application to not package or not to run properly when deployed.

Usingmcc

If you are usingmccto package your MATLAB code, the compiler does not display a list of required files before running. Instead, it packages all the required files that are discovered by the dependency analysis function and adds them to the generated binary file.

You can add files to the list by passing one or more-aarguments tomcc. The-aarguments add the specified files to the list of files to be added into the generated binary. For example,-a hello.madds the filehello.mto the list of required files and-a ./fooadds all the files infooand its subfolders to the list of required files.

Sample Driver File Creation

The following target types support sample driver file creation inMATLAB Compiler SDK™:

  • C++ shared library

  • Java®package

  • .NET assembly

  • Python®package

The sample driver file creation feature inLibrary Compileruses MATLAB code to generate sample driver files in the target language. The sample driver files are used to implement the generated shared libraries into an application in the target language. In the app, clickCreate New Sampleto automatically generate a new MATLAB script, or clickAdd Existing Sampleto upload a MATLAB script that you have already written. After you package your functions, a sample driver file in the target language is generated from your MATLAB script and is saved infor_redistribution_files_only\samples. Sample driver files are also included in the installer infor_redistribution.

To automatically generate a new MATLAB file, clickCreate New Sample. This opens up a MATLAB file for you to edit. The sample file serves as a starting point, and you can edit it as necessary based on the behavior of your exported functions. The sample MATLAB files must follow these guidelines:

  • The sample file code must use only exported functions.

  • Each exported function must be in a separate sample file.

  • Each call to the same exported function must be a separate sample file.

  • The output of the exported function must be an n-dimensional numeric, char, logical, struct, or cell array.

  • Data must be saved as a local variable and then passed to the exported function in the sample file code.

  • Sample file code should not require user interaction.

Additional considerations specific to the target language are as follows:

  • C++ mwArray API —vararginandvarargoutare not supported.

  • .NET — Type-safe API is not supported.

  • Python — Cell arrays and char arrays must be of size 1xN and struct arrays must be scalar. There are no restrictions on numeric or logical arrays, other than that they must be rectangular, as in MATLAB.

To upload a MATLAB file that you have already written, clickAdd Existing Sample. The MATLAB code should demonstrate how to execute the exported functions. The required MATLAB code can be only a few lines:

input1 = [1 4 7; 2 5 8; 3 6 9]; input2 = [1 4 7; 2 5 8; 3 6 9]; addoutput = addmatrix(input1,input2);
This code must also follow all the same guidelines outlined for theCreate New Sampleoption.

You can also choose not to include a sample driver file at all during the packaging step. If you create your own driver code in the target language, you can later copy and paste it into the appropriate directory once the MATLAB functions are packaged.

Specify Files to Install with Application

The compiler packages files to install along with the ones it generates. By default, the installer includes a readme file with instructions on installing the MATLAB Runtime and configuring it.

These files are listed in theFiles installed for your end usersection of the app.

To add files to the list, click,选取ect the file from the file explorer.

JAR文件添加到应用程序类路径as if you had calledjavaaddpath.

Caution

Removing the binary targets from the list results in an installer that does not install the intended functionality.

When installed on a target computer, the files listed in theFiles installed for your end userare saved in theapplicationfolder.

Additional Runtime Settings

Type of Packaged Application Description Additional Runtime Settings Options
Standalone Applications
  • Do not display the Windows Command Shell (console) for execution— If you select this option on a Windows platform, when you double-click the application from the file explorer, the application window opens without a command prompt.

  • Create log file— Generate a MATLAB log file for the application. The packaged application can't create a log file if installed in theC:folder on Windows because the application does not have write permission in that folder.

Excel Add-Ins
  • Register the component for the current user (Recommended for non-admin users)— This option enables registering the component for the current user account. It is provided for users without admin rights.

  • Create log file— Generate a MATLAB log file for the application. The packaged application can't create a log file if installed in theC:folder on Windows because the application does not have write permission in that folder.

See Also

|

Related Topics