compiler.package.InstallerOptions
Syntax
Description
creates a default opts
= compiler.package.InstallerOptions(results
)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.
creates an opts
= compiler.package.InstallerOptions(results
,Name,Value
)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.
creates an opts
= compiler.package.InstallerOptions('ApplicationName',appName
,Name,Value
)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
Create an Installer Options Object Using Results
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);
Create an InstallerOptions
object. Use name-value arguments to
specify the application name, author company, author name, installer name, and
summary.
opts = compiler.package.InstallerOptions(results,... '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\R2024b\toolbox\compiler\packagingResources\default_splash.png' InstallerIcon: 'C:\Program Files\MATLAB\R2024b\toolbox\compiler\packagingResources\default_icon_48.png' InstallerLogo: 'C:\Program Files\MATLAB\R2024b\toolbox\compiler\packagingResources\default_logo.png' AdditionalFiles: {} AddRemoveProgramsIcon: 'C:\Program Files\MATLAB\R2024b\toolbox\compiler\packagingResources\default_icon_48.png' AuthorName: 'Frog' AuthorEmail: '' AuthorCompany: 'Boston Common' Summary: 'Generates a magic square.' Description: '' InstallationNotes: '' Shortcut: 'D:\Work\magicsquarestandaloneApplication\magicsquare.exe' Version: '1.0' InstallerName: 'MagicSquare_Installer' ApplicationName: 'MagicSquare_Generator' OutputDir: '.\MagicSquare_Generatorinstaller' DefaultInstallationDir: 'C:\Program Files\MagicSquare_Generator' Verbose: 'off'
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);
MagicSquare_Installer
within a
folder named MagicSquare_Generatorinstaller
.You can modify the property values of an existing InstallerOptions
object using dot notation. For example, specify installation
notes.
opts.InstallationNotes = 'Windows installer for MagicSquare'
Create an Installer Options Object Using Application Name
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\R2024b\toolbox\compiler\packagingResources\default_splash.png' InstallerIcon: 'C:\Program Files\MATLAB\R2024b\toolbox\compiler\packagingResources\default_icon_48.png' InstallerLogo: 'C:\Program Files\MATLAB\R2024b\toolbox\compiler\packagingResources\default_logo.png' AdditionalFiles: {} AddRemoveProgramsIcon: '' 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' Verbose: 'off'
Input Arguments
results
— Build results object
Results
object
Build results, specified as a compiler.build.Results
object. Create the Results
object by
saving the output from a compiler.build
function.
appName
— Name of the installed application
character vector | string scalar
Name of the installed application, specified as a character vector or a string scalar.
Example: 'MagicSquare_Generator'
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.
AdditionalFiles
— Additional files
character vector | string scalar | cell array of character vectors | string array
Additional files and folders to be installed with the application, specified as a character vector, a string scalar, a string array, or a cell array of character vectors. Paths can be relative to the current working directory or absolute.
Example: 'AdditionalFiles',["myimage.png","data.mat"]
Data Types: char
| string
| cell
AddRemoveProgramsIcon
— Add or remove programs icon
character vector | string scalar | string array
Add or remove programs icon, specified as a character vector or string scalar. The image is used as the icon in the list of Windows® applications within settings. Paths can be relative to the current working directory or absolute.
The default path is:
'matlabroot
\toolbox\compiler\packagingResources\default_icon_48.png'
Example: 'AddRemoveProgramsIcon',"win_icon.png"
Data Types: char
| string
ApplicationName
— Application name
''
(default) | character vector | string scalar
Name of installed application, specified as a character vector or a string scalar.
Example: 'ApplicationName','MagicSquare_Generator'
Data Types: char
| string
AuthorCompany
— Company name
''
(default) | character vector | string scalar
Name of company that created the application, specified as a character vector or a string scalar.
Example: 'AuthorCompany','Boston Common'
Data Types: char
| string
AuthorEmail
— Email address
''
(default) | character vector | string scalar
Email address of the application author, specified as a character vector or a string scalar.
Example: 'AuthorEmail','frog@example.com'
Data Types: char
| string
AuthorName
— Name
''
(default) | character vector | string scalar
Name of application author, specified as a character vector or a string scalar.
Example: 'AuthorName','Frog'
Data Types: char
| string
DefaultInstallationDir
— Default installation path
character vector | string scalar
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 System | Default Installation Directory |
---|---|
Windows | C:\Program
Files\ |
Linux® | /usr/ |
macOS | /Applications/ |
Example: 'DefaultInstallationDir','C:\Users\MW_Programs\MagicSquare_Generator'
Data Types: char
| string
Description
— Detailed application description
''
(default) | character vector | string scalar
Detailed description of the application, specified as a character vector or a string scalar.
Example: 'Description','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
InstallationNotes
— Notes
''
(default) | character vector | string scalar
Notes about additional requirements for using application, specified as a character vector or a string scalar.
Example: 'InstallationNotes','This is a Linux installer.'
Data Types: char
| string
InstallerIcon
— Path to icon image
character vector | string scalar
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\packagingResources\default_icon_48.png'
Example: 'InstallerIcon','D:\Documents\MATLAB\work\images\myIcon.png'
InstallerLogo
— Path to installer image
character vector | string scalar
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 112 pixels by 290 pixels.
The default path is:
'matlabroot
\toolbox\compiler\packagingResources\default_logo.png'
Example: 'InstallerLogo','D:\Documents\MATLAB\work\images\myLogo.png'
InstallerName
— Name of installer file
MyAppInstaller
(default) | character vector | string scalar
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_Installer'
InstallerSplash
— Path to splash screen image
character vector | string scalar
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\compiler\packagingResources\default_splash.png'
Example: 'InstallerSplash','D:\Documents\MATLAB\work\images\mySplash.png'
OutputDir
— Path to folder where the installer will be saved
character vector | string scalar
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 System | Default Installation Directory |
---|---|
Windows | .\ |
Linux | ./ |
macOS | ./ |
The .
in the directories listed above
represents the present working directory.
Example: 'OutputDir','D:\Documents\MATLAB\work\MagicSquare'
PackageType
— Installer file type
'auto'
(default) | 'zip'
Choice on the file type of the generated installer.
'auto'
— Option for installer to automatically select the suitable package type when creating the installer. If the installer size is 2GB or greater, the installer is packaged as a ZIP file. This is the default option.'zip'
— Option to generate a ZIP file as an output when creating a new installer. This option is only supported on Windows.
Example: 'PackageType','zip'
Data Types: char
| string
RuntimeDelivery
— MATLAB® Runtime delivery option
'web'
(default) | 'installer'
| 'none'
MATLAB Runtime delivery option, specified as one of the following:
'web'
— Option for the installer to download MATLAB Runtime from the MathWorks® website during application installation. This option is the default behavior.'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 might not have access to the internet.'none'
— Option to not install MATLAB Runtime during application installation. Use this option if you think your end user will install MATLAB Runtime using another method. (since R2024a)
Note
If you use either the 'web'
or
'installer'
option, the full MATLAB Runtime will be installed. To create a
minimal MATLAB Runtime installer that can run one or more specific
MATLAB
Compiler™ applications, see compiler.runtime.customInstaller
. (since R2024b)
Example: 'RuntimeDelivery','installer'
Data Types: char
| string
Shortcut
— Path to shortcut
''
(default) | character vector | string scalar
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: 'Shortcut','.\mymagic.exe'
Data Types: char
| string
Summary
— Summary description of application
''
(default) | character vector | string scalar
Summary description of the application, specified as a character vector or a string scalar.
Example: 'Summary','Generates a magic
square.'
Data Types: char
| string
Version
— Version of installed application
'1.0'
(default) | character vector | string scalar
Version number of the installed application, specified as a character vector or a string scalar.
Example: 'Version','2.0'
Data Types: char
| string
Verbose
— Flag to control output verbosity
'off'
(default) | on/off logical value
Flag to control output verbosity, specified as 'on'
or
'off'
, or as numeric or logical 1
(true
) or 0
(false
). A value of 'on'
is equivalent to
true
, and 'off'
is equivalent to
false
. Thus, you can use the value of this property as a
logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState
.
If you set this property to
'on'
, then the MATLAB command window displays progress information indicating compiler output during the packaging process.If you set this property to
'off'
, then the command window does not display progress information. This is the default behavior.
Example: 'Verbose','on'
Data Types: logical
Output Arguments
opts
— Installer options object
InstallerOptions
object
Installer options, returned as an InstallerOptions
object.
Version History
Introduced in R2020a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)