Main Content

compiler.package.excelClientForProductionServer

Create an installer for an Excel client for MATLAB Production Server

Since R2021b

Description

compiler.package.excelClientForProductionServer(results) creates an Excel® client installer using the compiler.build.Results object results generated from the compiler.build.excelClientForProductionServer function.

example

compiler.package.excelClientForProductionServer(results,Name,Value) creates an installer using the compiler.build.Results object results with additional options specified using one or more name-value arguments.

example

compiler.package.excelClientForProductionServer(results,'Options',opts) creates an installer using the compiler.build.Results object results with installer options specified by an InstallerOptions object opts. If you use an InstallerOptions object, you cannot specify any other options using name-value arguments.

example

compiler.package.excelClientForProductionServer(files,clientLibrary,serverArchive) creates an installer for files generated by the mcc or compiler.build.excelClientForProductionServer command. clientLibrary is the name of Excel Client library and serverArchive is the name of the CTF file deployed on the Production Server.

example

compiler.package.excelClientForProductionServer(files,clientLibrary,serverArchive,Name,Value) creates an installer for files generated by the mcc or compiler.build.excelClientForProductionServer command. The installer can be customized using optional name-value arguments.

example

compiler.package.excelClientForProductionServer(files,'Options',opts) creates an installer for files generated by the mcc command with installer options specified by an InstallerOptions object opts. If you use an InstallerOptions object, you cannot specify any other options using name-value arguments.

example

Examples

collapse all

Create an installer for an Excel client using the results from the compiler.build.excelClientForProductionServer function.

In MATLAB®, locate the MATLAB code that you want to deploy as an Excel add-in for MATLAB Production Server™. For this example, compile using the file magicsquare.m located in matlabroot\extern\examples\compiler.

Save the path to the file magicsquare.m.

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

Build a production server archive application using the compiler.build.productionServerArchive command.

serverBuildResults = compiler.build.productionServerArchive(appFile);

Build the Excel client for the server archive using compiler.build.excelClientForProductionServer.

clientBuildResults = compiler.build.excelClientForProductionServer(serverBuildResults);

Create an installer for the Excel client using the compiler.package.excelClientForProductionServer function.

compiler.package.excelClientForProductionServer(clientBuildResults);
The function generates an installer named MyAppInstaller within a folder named magicsquareinstaller.

Create an installer for the Excel client using the results from the compiler.build.excelClientForProductionServer function and customize it using name-value arguments.

Save the path to the file magicsquare.m located in matlabroot\extern\examples\compiler.

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

Build a production server archive using the compiler.build.productionServerArchive command.

serverBuildResults = compiler.build.productionServerArchive(appFile);

Build the Excel client for the server archive using compiler.build.excelClientForProductionServer.

clientBuildResults = compiler.build.excelClientForProductionServer(serverBuildResults);

Create an installer for the Excel client using the compiler.package.excelClientForProductionServer function. Use name-value arguments to specify the server URL and installer name.

compiler.package.excelClientForProductionServer(clientBuildResults,...
'ServerURL','https://localhost:9988',...
'InstallerName','MagicSquare_Installer');
The function generates an installer named MagicSquare_Installer within a folder named magicsquareinstaller.

Create an installer for an Excel client using the results from the compiler.build.excelClientForProductionServer function and customize it using an InstallerOptions object.

Save the path to the file magicsquare.m located in matlabroot\extern\examples\compiler.

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

Build a production server archive application using the compiler.build.productionServerArchive command.

serverBuildResults = compiler.build.productionServerArchive(appFile);

Build the Excel client for the server archive using compiler.build.excelClientForProductionServer.

clientBuildResults = compiler.build.excelClientForProductionServer(serverBuildResults);

Create an ExcelClientForProductionServerOptions object. Use name-value arguments to specify the installer name and icon.

opts = compiler.package.ExcelClientForProductionServerOptions(clientBuildResults,...
    'InstallerName','MyClientInstaller')
    'InstallerIcon',which('peppers.png'))
opts = 

  ExcelClientForProductionServerOptions with properties:

      ServerArchive: 'magicsquare.ctf'
      ClientLibrary: 'magicsquare.dll'
      InstallerName: "MyClientInstaller"
      InstallerIcon: 'C:\Program Files\MATLAB\R2024b\toolbox\matlab\imagesci\peppers.png'
    MaxResponseSize: 750
      ServerTimeOut: 60
          ServerURL: ''
     SSLCertificate: ''
            Version: '1.0'
          OutputDir: '.\magicsquareExcelClientInstaller'

You can also modify the properties of an ExcelClientForProductionServerOptions object using dot notation.

opts.ServerTimeOut = 40;

Create an installer for the Excel client using the compiler.package.excelClientForProductionServer function and the Options object.

compiler.package.excelClientForProductionServer(clientBuildResults,...
    opts);

Create an installer for an Excel client on a Windows® system using the output from mcc.

Write a MATLAB function that generates a magic square. Save the function in a file named mymagic.m.

function out = mymagic(in)
out = magic(in)

Build a production server archive using the mcc command.

mcc -W CTF:mymagic -U -v mymagic.m
includedSupportPackages.txt
mccExcludedFiles.log
mymagic.ctf
readme.txt
requiredMCRProducts.txt
unresolvedSymbols.txt

Build a client-side Excel add-in using the mcc command.

mcc -W 'mpsxl:mymagic,Class1,version=1.0' -b -v class{Class1:mymagic.m} 
Class1.cs
mymagic.bas
mymagic.dll
mymagic.reg
mymagic.xla
readme.txt

Create an installer for the Excel client using the files generated by mcc.

compiler.package.excelClientForProductionServer(...
    {'mymagic.dll','mymagic.xla'},...
    'ClientLibrary','mymagic.dll',...
    'ServerArchive','mymagic.ctf')
The function generates an installer named ServerArchiveExcelClientInstaller.exe within a folder named ServerArchiveExcelClientInstaller.

Customize an installer for an Excel client using name-value arguments.

Build a production server archive using the compiler.build.productionServerArchive command.

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

Save the path to the generated magicsquare.ctf file.

serverArchive = fullfile(serverBuildResults.Options.OutputDir,'magicsquare.ctf');

Build the Excel client for the server archive using compiler.build.excelClientForProductionServer.

clientBuildResults = compiler.build.excelClientForProductionServer(serverBuildResults);

Save the paths to the generated magicsquare.xla and magicsquare.dll files.

ExcelAddIn = fullfile(clientBuildResults.Options.OutputDir,'magicsquare.xla');
clientLibrary = fullfile(clientBuildResults.Options.OutputDir,'magicsquare.dll');

Create an installer for the Excel client using the compiler.package.excelClientForProductionServer function.

compiler.package.excelClientForProductionServer(...
    {clientLibrary,ExcelAddIn},...
    'ClientLibrary',clientLibrary,...
    'ServerArchive',serverArchive,...
    'OutputDir','magicExcelMPSInstaller',...
    'InstallerName','magicInstaller')

Customize an installer for an Excel client using an InstallerOptions object.

  1. Build a production server archive using the mcc command.

    mcc -W CTF:magicsquare -U -v magicsquare.m
  2. Build a client-side Excel add-in using the mcc command.

    mcc -W 'mpsxl:magicsquare,Class1,version=1.0' -b -v class{Class1:magicsquare.m} 
  3. Create an ExcelClientForProductionServerOptions object. Use name-value arguments to specify the installer name and icon.

    opts = compiler.package.ExcelClientForProductionServerOptions(...
        'ClientLibrary','magicsquare.dll',...
        'ServerArchive','magicsquare.ctf',...
        'Version','2.0');

Input Arguments

collapse all

Excel client build results, specified as a compiler.build.Results object. Create the Results object by saving the output from the compiler.build.excelClientForProductionServer function.

List of files and folders for installation, specified as a cell array of character vectors or a string array. These files are typically generated by the mcc command or the compiler.build.excelClientForProductionServer function and can also include any additional files and folders required by the installed add-in to run. Additional files are installed in the installation directory along with the application executable.

  • Files generated in a particular release can be packaged using the compiler.package.excelClientForProductionServer function of the same release.

  • Files of type .ctf on one operating system can be packaged using the compiler.package.excelClientForProductionServer function on a different operating system, as long as the build command and the compiler.package.excelClientForProductionServer function are from the same release.

Example: {'magic.dll','magic.xla','readme.txt'}

Data Types: string | cell

Installer options, specified as an ExcelClientForProductionServerOptions object.

Excel client library, specified as a character vector or a string scalar.

Example: 'D:\Documents\MATLAB\work\MagicSquare\magic.dll

Data Types: char | string

Name of the production server archive, specified as a character vector or a string scalar.

Example: 'D:\Documents\MATLAB\work\MagicSquare\magic.ctf

Data Types: char | string

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'Version','9.5' specifies the version of the installed application.

Name of the installer file, specified as a character vector or a string scalar. The extension is determined by the operating system in which the function is executed.

Example: 'InstallerName','MagicSquare_Excel_Installer'

Path to an image file used as the installer's icon, specified as a character vector or a string scalar.

The default path is:

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

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

Path to folder where the installer is saved, specified as a character vector or a string scalar.

If no path is specified, the default path for each operating system is:

Operating SystemDefault Installation Directory
Windows.\addInNameExcelClientInstaller
Linux®./addInNameExcelClientInstaller
macOS./addInNameExcelClientInstaller

The . in the directories listed above represents the present working directory.

Example: 'OutputDir','D:\Documents\MATLAB\work\myExcelMPSInstaller'

Maximum size of the response the client accepts, specified as a size in megabytes (MB)

Example: 'MaxResponseSize',420

Server time out delay, specified in seconds. The value specifies how long the client waits for a response before it times out.

Example: 'ServerTimeOut',200

MATLAB Production server URL, specified as a character vector or a string scalar. It must have the following format:

http://path.to.url:port

Example: 'ServerURL','https://localhost:9988'

Data Types: char | string

Path to the self signed certificate for HTTPS, specified as a character vector or a string scalar.

Example: 'SSLCertificate','domain.crt'

Data Types: char | string

Version number of the installed application, specified as a character vector or a string scalar.

Example: 'Version','2.0'

Data Types: char | string

Version History

Introduced in R2021b