Main Content

compiler.package.InstallerOptions

Options for creating MATLAB Compiler package installers

Description

example

opts = compiler.package.InstallerOptions(results) creates a default InstallerOptions object opts using the compiler.build.Results object results generated from a compiler.build function. The InstallerOptions object is passed as an input to the compiler.package.installer function.

example

opts = compiler.package.InstallerOptions(results,Name,Value) creates an InstallerOptions object opts using the compiler.build.Results object results with additional options specified using one or more name-value arguments. The InstallerOptions object is passed as an input to the compiler.package.installer function.

example

opts = compiler.package.InstallerOptions('ApplicationName',appName) creates a default InstallerOptions object opts with application name specified by appName. The InstallerOptions object is passed as an input to the compiler.package.installer function.

example

opts = compiler.package.InstallerOptions('ApplicationName',appName,Name,Value) creates an InstallerOptions object opts with application name specified by appName and additional customizations specified by name-value arguments. The InstallerOptions object is passed as an input to the compiler.package.installer function.

Examples

collapse all

Create an InstallerOptions object using the results from the compiler.build.standaloneApplication function and additional options specified as name-value arguments.

For this example, build a standalone application using the file magicsquare.m located in matlabroot\extern\examples\compiler.

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

  Results with properties:

            BuildType: 'standaloneApplication'
                Files: {2×1 cell}
              Options: [1×1 compiler.build.StandaloneApplicationOptions]
opts = compiler.package.InstallerOptions(results,'AuthorName','Frog')
opts = 

  InstallerOptions with properties:

           RuntimeDelivery: 'web'
           InstallerSplash: 'C:\Program Files\MATLAB\R2021a\toolbox\toolbox\compiler\resources\default_splash.png'
             InstallerIcon: 'C:\Program Files\MATLAB\R2021a\toolbox\compiler\resources\default_icon_48.png'
             InstallerLogo: 'C:\Program Files\MATLAB\R2021a\toolbox\compiler\resources\default_logo.png'
                AuthorName: 'Frog'
               AuthorEmail: ''
             AuthorCompany: ''
                   Summary: ''
               Description: ''
         InstallationNotes: ''
                  Shortcut: ''
                   Version: ''
             InstallerName: 'MyAppInstaller'
           ApplicationName: 'magicsquare'
                 OutputDir: '.\magicsquare'
    DefaultInstallationDir: 'C:\Program Files\magicsquare'

You can modify the property values of an existing InstallerOptions object using dot notation. For example, set the installer name to MyMagicInstaller.

opts.InstallerName = 'MyMagicInstaller'

To create an installer for the standalone application, use the Results and InstallerOptions objects as inputs to the compiler.package.installer function.

compiler.package.installer(results,'Options',opts);
The function generates an installer named MyMagicInstaller.exe within a folder named magicsquareinstaller.

Create an InstallerOptions object with an application name and additional options specified as name-value arguments.

opts = compiler.package.InstallerOptions('ApplicationName','MagicSquare_Generator',...
    'AuthorCompany','Boston Common',...
    'AuthorName','Frog',...
    'InstallerName','MagicSquare_Installer',...
    'Summary','Generates a magic square.')
opts = 

  InstallerOptions with properties:

           RuntimeDelivery: 'web'
           InstallerSplash: 'C:\Program Files\MATLAB\R2021a\toolbox\toolbox\compiler\resources\default_splash.png'
             InstallerIcon: 'C:\Program Files\MATLAB\R2021a\toolbox\compiler\resources\default_icon_48.png'
             InstallerLogo: 'C:\Program Files\MATLAB\R2021a\toolbox\compiler\resources\default_logo.png'
                AuthorName: 'Frog'
               AuthorEmail: ''
             AuthorCompany: 'Boston Common'
                   Summary: 'Generates a magic square.'
               Description: ''
         InstallationNotes: ''
                  Shortcut: ''
                   Version: '1.0'
             InstallerName: 'MagicSquare_Installer'
           ApplicationName: 'MagicSquare_Generator'
                 OutputDir: '.\MagicSquare_Generator'
    DefaultInstallationDir: 'C:\Program Files\MagicSquare_Generator'

You can modify the property values of an existing InstallerOptions object using dot notation. For example, set the installation notes to Windows installer.

opts.InstallationNotes = 'Windows installer'

Input Arguments

collapse all

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

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

Example: 'MagicSquare_Generator'

Data Types: char | string

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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

Name of installed application, specified as a character vector or a string scalar.

Example: 'MagicSquare_Generator'

Data Types: char | string

Name of company that created the application, specified as a character vector or a string scalar.

Example: 'Boston Common'

Data Types: char | string

Email address of the application author, specified as a character vector or a string scalar.

Example: 'frog@bostoncommon.com'

Data Types: char | string

Name of application author, specified as a character vector or a string scalar.

Example: 'Frog'

Data Types: char | string

Default directory where you want the installer to install the application, 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®C:\Program Files\appName
Linux®/usr/appName
macOS/Applications/appName

Example: On Windows: C:\Program Files\MagicSquare_Generator

Data Types: char | string

Detailed description of the application, specified as a character vector or a string scalar.

Example: 'The MagicSquare_Generator application generates an n-by-n matrix constructed from the integers 1 through n2 with equal row and column sums.'

Data Types: char | string

Notes about additional requirements for using application, specified as a character vector or a string scalar.

Example: 'This is a Linux installer.'

Data Types: char | string

Path to an image file used as the icon for the installed application, specified as a character vector or a string scalar.

The default path is:

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

Example: 'D:\Documents\MATLAB\work\images\myIcon.png'

Path to an image file used as the installer's logo, specified as a character vector or a string scalar. The logo will be resized to 150 pixels by 340 pixels.

The default path is:

'matlabroot\toolbox\compiler\resources\default_logo.png'

Example: 'D:\Documents\MATLAB\work\images\myLogo.png'

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: 'MagicSquare_Installer'

Path to an image file used as the installer's splash screen, specified as a character vector or a string scalar. The splash screen icon will be resized to 400 pixels by 400 pixels.

The default path is:

'matlabroot\toolbox\toolbox\compiler\resources\default_splash.png'

Example: 'D:\Documents\MATLAB\work\images\mySplash.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.\appNameinstaller
Linux./appNameinstaller
macOS./appNameinstaller

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

Example: 'D:\Documents\MATLAB\work\MagicSquare'

Choice on how the MATLAB Runtime is made available to the installed application.

  • 'web'—Option for installer to download MATLAB Runtime from MathWorks® website during application installation. This is the default option.

  • 'installer'—Option to include MATLAB Runtime within the installer so that it can be installed during application installation without connecting to the MathWorks website. Use this option if you think your end-user may not have access to the Internet.

Example: 'installer'

Data Types: char | string

Path to a file or folder that the installer will create a shortcut to at install time, specified as a character vector or a string scalar.

Example: '.\mymagic.exe'

Data Types: char | string

Summary description of the application, specified as a character vector or a string scalar.

Example: 'Generates a magic square.'

Data Types: char | string

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

Example: '2.0'

Data Types: char | string

Output Arguments

collapse all

Installer options, returned as an InstallerOptions object.

Introduced in R2020a