Main Content

自定义应用程序

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应用程序。

自定义安装程序

更改应用程序图标

要更改默认图标,请单击该图的图形库名称orApplication name预览图标的字段。

点击选择图标,并找到图形文件以用作应用程序图标。选择Use maskoption to fill any blank spaces around the icon with white or the使用边框在图标周围添加边框的选项。

To return to the main window, click保存和使用

Add Library or Application Information

You can provide further information about your application as follows:

  • Library/Application Name: The name of the installed MATLAB®文物。例如,如果名称为foo, the installed executable isfoo。exe和窗户®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.

  • 作者名称:开发人员的名称。

  • 万博1manbetx支持电子邮件地址:电子邮件地址用于联系信息。

  • 公司名称:已安装的MATLAB工件的完整安装路径。例如,如果公司名称为酒吧, the full installation path would beInstallRoot/酒吧/ApplicationName

  • 摘要:描述申请的简要摘要。

  • 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 Programs控制面板。

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 the选择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 /申请/companyName/appName
Linux® /usr/companyName/appName

You can change the default installation path by editing theDefault installation folder领域Additional installer options

指定附加在根文件夹的路径的文本字段是您的安装文件夹。您可以为应用程序安装文件夹选择根文件夹。该表列出了每个平台的可选自定义根文件夹:

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.

您更改了默认图像Additional Installer Optionsby clicking选择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.

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.

如果您使用的是一个编译器应用程序,则依赖关系分析功能发现的所需文件在Files required for your application to runorFiles required for your library to run场地。

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.

使用mcc

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.

您可以通过一个或多个将文件添加到列表中-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 file你好到所需的文件列表,-a ./foo将所有文件添加到foo及其子文件夹列为所需文件列表。

示例驱动程序文件创建

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

  • C++ shared library

  • 爪哇®package

  • 。NET assembly

  • Python®package

示例驱动程序文件创建功能Library Compiler使用MATLAB代码以目标语言生成示例驱动程序文件。示例驱动程序文件用于用目标语言实现生成的共享库中的应用程序。在应用程序中,单击Create New Sample要自动生成新的MATLAB脚本,或单击Add 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。示例驱动程序文件也包含在安装程序中for_redistribution

要自动生成新的MATLAB文件,请单击Create New Sample。这为您打开一个MATLAB文件供您编辑。示例文件是起点,您可以根据导出功能的行为根据需要进行编辑。示例MATLAB文件必须遵循以下准则:

  • 示例文件代码必须仅使用导出的功能。

  • 每个导出功能必须在单独的示例文件中。

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

  • 导出函数的输出必须是n维数字,char,逻辑,结构或单元格数组。

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

  • 年代ample file code should not require user interaction.

目标语言特定的其他注意事项如下:

  • C++ mwArray API —vararginandvarargout不支持。万博1manbetx

  • .NET - 不支持类型安全的API。万博1manbetx

  • 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.

要上传您已经编写的MATLAB文件,请单击Add Existing Sample。MATLAB代码应演示如何执行导出的功能。所需的MATLAB代码只能是几行:

input1 = [1 4 7; 2 5 8; 3 6 9]; input2 = [1 4 7; 2 5 8; 3 6 9]; addoutput = addmatrix(input1,input2);
该代码还必须遵循有关该规定的所有相同准则Create 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.

年代pecify Files to Install with Application

编译器包装文件以及生成的文件。默认情况下,安装程序包含一个带有读数文件,其中包含有关安装MATLAB运行时并配置它的说明。

These files are listed in the为您的最终用户安装的文件section of the app.

To add files to the list, click,并从文件资源管理器中选择文件。

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 the为您的最终用户安装的文件are saved in theapplication文件夹。

其他运行时设置

Type of Packaged Application Description 其他运行时设置Options
Generic COM Components
  • 注册当前用户的组件(建议非Admin用户)—This option enables registering the component for the current user account. It is provided for users without admin rights.

。NET Assembly
  • 创建共享组件- 启用分享MATLAB Runtimeinstaller instances for multiple .NET assemblies.

  • 启用.NET远程- 使您能够作为分布式系统的一部分远程访问MATLAB功能。有关更多信息,请参阅创建可远方的.NET组件

  • 启用类型的安全API— Enables the type safe API for the packaged .NET assembly.

API Selection for C++ Shared Library

  • 创建所有接口- 使用两者都为共享库创建接口MwarrayAPI和MATLAB数据API。

  • Create interface that uses the mwArray API- 使用该库创建一个界面MwarrayAPI。该接口使用C风格函数来初始化MATLAB Runtime, load the compiled MATLAB functions into theMATLAB Runtime, and manage data that is passed between the C++ code and theMATLAB Runtime。The interface supports only C++03 functionality. For an example, seeGenerate a C++ mwArray API Shared Library and Build a C++ Application

  • 创建使用MATLAB数据API的界面- 使用MATLAB数据API创建共享库的接口。它使用具有现代C ++语义的通用接口。该接口支持C ++ 11功能万博1manbetx。有关更多信息,请参阅Generate a C++ MATLAB Data API Shared Library and Build a C++ Application

也可以看看

Related Topics