主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

compiler.package.ExcelClientForProductionServerOptions

MATLAB Production ServerExcel 客户端创建安装程序的选项

自 R2021b 起

说明

opts = compiler.package.ExcelClientForProductionServerOptions(results) 使用从 compiler.build.excelClientForProductionServer 函数生成的 compiler.build.Results 对象 opts 创建默认的 ExcelClientForProductionServerOptions 对象 resultsExcelClientForProductionServerOptions 对象作为输入传递给 compiler.package.excelClientForProductionServer 函数。

示例

opts = compiler.package.ExcelClientForProductionServerOptions(results,Name,Value) 使用 compiler.build.Results 对象 opts 创建一个 ExcelClientForProductionServerOptions 对象 results,并使用一个或多个 名称-值参量指定其他选项。

示例

opts = compilation.ExcelClientForProductionServerOptions(opts opts = compiler.package.ExcelClientForProductionServerOptions(clientLibrary,serverArchive) 创建一个 ExcelClientForProductionServerOptions 对象 clientLibrary。clientLibrary 是正在安装的 Excel 客户端库的名称,serverArchive 是部署在生产服务器上的 CTF 存档的名称。

示例

opts = compiler.package.ExcelClientForProductionServerOptions(clientLibrary,serverArchive,Name,Value) 使用客户端库和服务器存档以及由名称-值参量指定的其他自定义项创建 ExcelClientForProductionServerOptions 对象 opts

示例

示例

全部折叠

使用 compiler.build.excelClientForProductionServer 函数的结果创建一个 ExcelClientForProductionServerOptions 对象。您可以使用名称-值参量指定其他选项。

对于此示例,使用位于 magicsquare.m 文件 matlabroot\extern\examples\compiler 构建生产服务器存档。

appFile = fullfile(matlabroot,'extern','examples','compiler','magicsquare.m');
serverBuildResults = compiler.build.productionServerArchive(appFile);

使用 compiler.build.excelClientForProductionServer 为服务器存档构建 Excel® 客户端。

clientBuildResults = compiler.build.excelClientForProductionServer(serverBuildResults);

创建一个 ExcelClientForProductionServerOptions 对象。使用名称-值参量指定应用程序名称、作者公司、作者姓名、安装程序名称和摘要。

opts = compiler.package.ExcelClientForProductionServerOptions(clientBuildResults,...
    'ServerURL','https://localhost:9988')
opts = 

  ExcelClientForProductionServerOptions with properties:

      ServerArchive: 'magicsquare.ctf'
      ClientLibrary: 'magicsquare.dll'
      InstallerName: "magicsquareExcelClientInstaller"
      InstallerIcon: 'C:\Program Files\MATLAB\R2025a\toolbox\compiler\packagingResources\default_icon_48.png'
    MaxResponseSize: 750
      ServerTimeOut: 60
          ServerURL: 'https://localhost:9988'
     SSLCertificate: ''
            Version: '1.0'
          OutputDir: '.\magicsquareExcelClientInstaller'

您可以使用点符号修改现有 ExcelClientForProductionServerOptions 对象的属性值。例如,将安装程序名称设置为 MyMagicInstaller

opts.InstallerName = 'MyMagicInstaller'

要为独立应用程序创建安装程序,请使用 ResultsExcelClientForProductionServerOptions 对象作为 compiler.package.installer 函数的输入。

compiler.package.excelClientForProductionServer(clientBuildResults,'Options',opts);
该函数在名为 MyMagicInstaller 的文件夹中生成一个名为 magicsquareExcelClientInstaller 的安装程序。

使用客户端库和服务器存档以及指定为名称-值参量的附加选项创建 ExcelClientForProductionServerOptions 对象。

使用 mcc 命令构建生产服务器存档。

mcc -W CTF:magicsquare -U -v magicsquare.m

使用 mcc 命令构建客户端 Excel 加载项。

mcc -W 'mpsxl:magicsquare,Class1,version=1.0' -b -v class{Class1:magicsquare.m} 

创建一个 ExcelClientForProductionServerOptions 对象。使用名称-值参量指定最大服务器响应大小和超时延迟(以秒为单位)。

opts = compiler.package.ExcelClientForProductionServerOptions(...
    'ClientLibrary', 'magicsquare.dll',...
    'ServerArchive','magic.ctf',...
    'MaxResponseSize',1024,...
    'ServerTimeOut',200)
opts = 

  ExcelClientForProductionServerOptions with properties:

      ServerArchive: 'magic.ctf'
      ClientLibrary: 'ClientLibrary.dll'
      InstallerName: "ClientLibraryExcelClientInstaller"
      InstallerIcon: 'C:\Program Files\MATLAB\R2025a\toolbox\compiler\packagingResources\default_icon_48.png'
    MaxResponseSize: 1024
      ServerTimeOut: 200
          ServerURL: ''
     SSLCertificate: ''
            Version: '1.0'
          OutputDir: '.\ClientLibraryExcelClientInstaller'

输入参数

全部折叠

Excel 客户端构建结果,指定为 compiler.build.Results 对象。通过保存 compiler.build.excelClientForProductionServer 函数的输出来创建 Results 对象。

Excel 客户端库,指定为字符向量或字符串标量。

示例: 'D:\Documents\MATLAB\work\MagicSquare\magic.dll

数据类型: char | string

生产服务器存档的名称,指定为字符向量或字符串标量。

示例: 'D:\Documents\MATLAB\work\MagicSquare\magic.ctf

数据类型: char | string

名称-值参数

全部折叠

Name1=Value1,...,NameN=ValueN 的形式指定可选参量对组,其中 Name 是参量名称,Value 是对应的值。名称-值参量必须出现在其他参量之后,但对各个参量对组的顺序没有要求。

如果使用的是 R2021a 之前的版本,请使用逗号分隔每个名称和值,并用引号将 Name 引起来。

示例: 'Version','9.5' 指定已安装应用程序的版本。

安装程序文件的名称,指定为字符向量或字符串标量。扩展名由执行该函数的操作系统决定。

示例: 'InstallerName','MagicSquare_Excel_Installer'

用作安装程序图标的图像文件的路径,指定为字符向量或字符串标量。

默认路径为:

'matlabroot\toolbox\compiler\packagingResources\default_icon_48.png'

示例: 'InstallerSplash','D:\Documents\MATLAB\work\images\myicon.png'

保存安装程序的文件夹路径,指定为字符向量或字符串标量。

若未指定路径,则各个操作系统的默认路径为:

操作系统默认安装目录
Windows®.\addInNameExcelClientInstaller
Linux®./addInNameExcelClientInstaller
macOS./addInNameExcelClientInstaller

上面列出的目录中的 . 代表当前工作目录。

示例: 'OutputDir','D:\Documents\MATLAB\work\myExcelMPSInstaller'

客户端接受的响应的最大大小,以兆字节 (MB) 为单位

示例: 'MaxResponseSize',420

服务器超时延迟,以秒为单位指定。该值指定客户端在超时之前等待响应的时间。

示例: 'ServerTimeOut',200

MATLAB 生产服务器 URL,指定为字符向量或字符串标量。它必须具有以下格式:

http://path.to.url:port

示例: 'ServerURL','https://localhost:9988'

数据类型: char | string

HTTPS 的自签名证书的路径,指定为字符向量或字符串标量。

示例: 'SSLCertificate','domain.crt'

数据类型: char | string

已安装应用程序的版本号,指定为字符向量或字符串标量。

示例: 'Version','2.0'

数据类型: char | string

输出参量

全部折叠

安装程序选项,作为 ExcelClientForProductionServerOptions 对象返回。

版本历史记录

在 R2021b 中推出