このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
compiler.package.installer
構文
説明
compiler.package.installer(
は、関数 results
)compiler.build
から生成された compiler.build.Results
オブジェクト results
を使用してインストーラーを作成します。
compiler.package.installer(
は、results
,Name,Value
)compiler.build.Results
オブジェクト results
と、名前と値の引数を 1 つ以上使って指定した追加オプションを用いてインストーラーを作成します。
compiler.package.installer(
は、files
,filePath
,'ApplicationName',appName
,Name,Value
)mcc
コマンドによって生成されたファイル用のインストーラーを作成します。インストールされるアプリケーションの名前は appName
で指定します。インストーラーは、オプションの名前と値の引数を使用してカスタマイズできます。
例
結果オブジェクトを使用したインストーラーの作成
関数 compiler.build.standaloneApplication
からの結果を使用して、スタンドアロン アプリケーションのインストーラーを作成します。
MATLAB® で、スタンドアロン アプリケーションとしてデプロイする MATLAB コードを見つけます。この例では、
にあるファイル matlabroot
\extern\examples\compilermagicsquare.m
を使用してコンパイルします。
appFile = fullfile(matlabroot,'extern','examples','compiler','magicsquare.m');
compiler.build.standaloneApplication
コマンドを使用して、スタンドアロン アプリケーションをビルドします。
results = compiler.build.standaloneApplication(appFile);
関数 compiler.package.installer
を使用して、スタンドアロン アプリケーションのインストーラーを作成します。
compiler.package.installer(results);
magicsquareinstaller
というフォルダー内に MyAppInstaller
というインストーラーを生成します。結果オブジェクトを使用したインストーラーのカスタマイズ
関数 compiler.build.standaloneApplication
からの結果を使用してスタンドアロン アプリケーションのインストーラーを作成し、名前と値の引数を使用してカスタマイズします。
にある matlabroot
\extern\examples\compilermagicsquare.m
ファイルへのパスを保存します。
appFile = fullfile(matlabroot,'extern','examples','compiler','magicsquare.m');
compiler.build.standaloneApplication
コマンドを使用して、スタンドアロン アプリケーションをビルドします。
results = compiler.build.standaloneApplication(appFile);
関数 compiler.package.installer
で Results
オブジェクトを使用して、スタンドアロン アプリケーションのインストーラーを作成します。名前と値の引数を使用してインストーラー名を指定し、インストーラーに MATLAB Runtime を含めます。
compiler.package.installer(results, ... 'InstallerName','MyMagicInstaller', ... 'RuntimeDelivery','installer');
magicsquareinstaller
というフォルダー内に MyMagicInstaller
というインストーラーを生成します。結果オブジェクトとオプション オブジェクトを使用したインストーラーのカスタマイズ
関数 compiler.build.standaloneApplication
からの結果を使用して、Windows® システムでスタンドアロン アプリケーションのインストーラーを作成します。InstallerOptions
オブジェクトを使用してインストーラーをカスタマイズします。
にある matlabroot
\extern\examples\compilermagicsquare.m
ファイルへのパスを保存します。
appFile = fullfile(matlabroot,'extern','examples','compiler','magicsquare.m');
compiler.build.standaloneApplication
コマンドを使用して、スタンドアロン アプリケーションをビルドします。
results = compiler.build.standaloneApplication(appFile);
InstallerOptions
オブジェクトを作成します。名前と値の引数を使用して、アプリケーション名、作成会社、作成者名、インストーラー名、および概要を指定します。
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\R2022b\toolbox\toolbox\compiler\packagingResources\default_splash.ico' InstallerIcon: 'C:\Program Files\MATLAB\R2022b\toolbox\compiler\packagingResources\default_icon_48.ico' InstallerLogo: 'C:\Program Files\MATLAB\R2022b\toolbox\compiler\packagingResources\default_logo.ico' 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_Generatorinstaller' DefaultInstallationDir: 'C:\Program Files\MagicSquare_Generator'
Results
オブジェクトと InstallerOptions
オブジェクトを関数 compiler.package.installer
への入力として使用し、スタンドアロン アプリケーションのインストーラーを作成します。
compiler.package.installer(results,'Options',opts);
MagicSquare_Generatorinstaller
というフォルダー内に MagicSquare_Installer
というインストーラーを生成します。ファイルを使用したインストーラーの作成
Windows システムのスタンドアロン アプリケーションのインストーラーを作成します。
魔方陣を生成する MATLAB 関数を記述します。この関数を mymagic.m
という名前のファイルに保存します。
function out = mymagic(in)
out = magic(in)
mcc
コマンドを使用して、スタンドアロン アプリケーションをビルドします。
mcc -m mymagic.m
mymagic.exe mccExcludedFiles.log readme.txt requiredMCRProducts.txt
関数 compiler.package.installer
を使用して、スタンドアロン アプリケーションのインストーラーを作成します。
compiler.package.installer('mymagic.exe', ... 'D:\Documents\MATLAB\work\MagicSquare\requiredMCRProducts.txt', ... 'ApplicationName','MagicSquare_Generator')
MagicSquare_Generatorinstaller
という名前のフォルダー内に MyAppInstaller.exe
という名前のインストーラーを生成します。ファイルを使用したインストーラーのカスタマイズ
名前と値の引数を使用して、スタンドアロン アプリケーションのインストーラーをカスタマイズします。
compiler.build.standaloneApplication
コマンドを使用して、スタンドアロン アプリケーションをビルドします。
appFile = fullfile(matlabroot,'extern','examples','compiler','magicsquare.m'); buildResults = compiler.build.standaloneApplication(appFile);
生成された requiredMCRProducts.txt
ファイルへのパスを保存します。
runtimeProducts = fullfile(buildResults.Options.OutputDir,'requiredMCRProducts.txt')
スタンドアロン アプリケーションのビルド結果からのファイルのリストを保存します。
fileList = buildResults.Files
オプションで fileList
を変更して、さらにファイルをインストーラーに追加できます。追加ファイルはアプリケーションの実行可能ファイルと共に、インストール ディレクトリにインストールされます。
fileList = [fileList; {'UsageNotes.txt'}];
関数 compiler.package.installer
を使用して、スタンドアロン アプリケーションのインストーラーを作成します。
compiler.package.installer(fileList, runtimeProducts, ... 'ApplicationName','CustomMagicSquare', ... 'InstallerName','Installer_With_Addl_Files', ... 'Summary','See UsageNotes.txt for info.')
ファイルとインストーラー オプション オブジェクトを使用したインストーラーのカスタマイズ
InstallerOptions
オブジェクトを使用して、Windows システムのスタンドアロン アプリケーションのインストーラーをカスタマイズします。
InstallerOptions
オブジェクトを作成します。
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\R2022b\toolbox\toolbox\compiler\packagingResources\default_splash.ico' InstallerIcon: 'C:\Program Files\MATLAB\R2022b\toolbox\compiler\packagingResources\default_icon_48.ico' InstallerLogo: 'C:\Program Files\MATLAB\R2022b\toolbox\compiler\packagingResources\default_logo.ico' 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'
InstallerOptions
オブジェクトを入力として関数に渡します。
compiler.package.installer('mymagic.exe','requiredMCRProducts.txt','Options',opts)
入力引数
results
— ビルド結果オブジェクト
Results
オブジェクト
ビルド結果。compiler.build.Results
オブジェクトとして指定します。関数 compiler.build
からの出力を保存することで、Results
オブジェクトを作成します。
files
— インストール用のファイルとフォルダーのリスト
文字ベクトル | string スカラー | 文字ベクトルの cell 配列 | string 配列
インストール用のファイルとフォルダーのリスト。文字ベクトル、string スカラー、文字ベクトルの cell 配列、または string 配列として指定します。これらのファイルは、通常、mcc
コマンドまたは関数 compiler.build
によって生成され、インストールされるアプリケーションの実行に必要な追加のファイルおよびフォルダーも含めることができます。追加ファイルはアプリケーションの実行可能ファイルと共に、インストール ディレクトリにインストールされます。
特定のリリースで生成されたファイルは、同じリリースの関数
compiler.package.installer
を使用してパッケージ化できます。あるオペレーティング システム上のタイプ
.ctf
のファイルは、別のオペレーティング システムで関数compiler.package.installer
を使用してパッケージ化できます。ただし、ビルド コマンドと関数compiler.package.installer
のリリースが同じである場合に限られます。
例: {'mymagic.exe','UsageNotes.txt'}
データ型: char
| string
filePath
— requiredMCRProducts.txt
ファイルへのパス
文字ベクトル | string スカラー
MATLAB Compiler™ によって生成された requiredMCRProducts.txt
ファイルへのパス。
例: 'D:\Documents\MATLAB\work\MagicSquare\requiredMCRProducts.txt'
データ型: char
| string
appName
— インストールされるアプリケーションの名前
文字ベクトル | string スカラー
インストールされるアプリケーションの名前。文字ベクトルまたは string スカラーとして指定します。
例: 'MagicSquare_Generator'
データ型: char
| string
opts
— InstallerOptions オブジェクト
InstallerOptions
オブジェクト
インストーラー オプション。InstallerOptions
オブジェクトとして指定します。
名前と値の引数
オプションのペアの引数を Name1=Value1,...,NameN=ValueN
として指定します。ここで、Name
は引数名で、Value
は対応する値です。名前と値の引数は他の引数の後に指定する必要がありますが、ペアの順序は考慮されません。
R2021a より前では、コンマを使用してそれぞれの名前と値を区切り、Name
を引用符で囲みます。
例: 'Version','9.5'
は、インストールされているアプリケーションのバージョンを指定します。
ApplicationName
— アプリケーション名
''
(既定値) | 文字ベクトル | string スカラー
インストールされるアプリケーションの名前。文字ベクトルまたは string スカラーとして指定します。
例: 'MagicSquare_Generator'
データ型: char
| string
AuthorCompany
— 会社名
''
(既定値) | 文字ベクトル | string スカラー
アプリケーションを作成した会社名。文字ベクトルまたは string スカラーとして指定します。
例: 'Boston Common'
データ型: char
| string
AuthorEmail
— 電子メール アドレス
''
(既定値) | 文字ベクトル | string スカラー
アプリケーション作成者の電子メール アドレス。文字ベクトルまたは string スカラーとして指定します。
例: 'frog@bostoncommon.com'
データ型: char
| string
AuthorName
— 名前
''
(既定値) | 文字ベクトル | string スカラー
アプリケーション作成者の名前。文字ベクトルまたは string スカラーとして指定します。
例: 'Frog'
データ型: char
| string
DefaultInstallationDir
— 既定のインストール パス
文字ベクトル | string スカラー
インストーラーがアプリケーションをインストールする既定のディレクトリ。文字ベクトルまたは string スカラーとして指定します。
パスを指定しない場合、各オペレーティング システムの既定のパスは次のとおりです。
オペレーティング システム | 既定のインストール ディレクトリ |
---|---|
Windows | C:\Program Files\ |
Linux® | /usr/ |
macOS | /Applications/ |
例: Windows の場合: C:\Program Files\MagicSquare_Generator
データ型: char
| string
Description
— アプリケーションの詳細な説明
''
(既定値) | 文字ベクトル | string スカラー
アプリケーションの詳細な説明。文字ベクトルまたは string スカラーとして指定します。
例: 'The MagicSquare_Generator application generates an n-by-n matrix constructed from the integers 1 through n2 with equal row and column sums.'
データ型: char
| string
InstallationNotes
— メモ
''
(既定値) | 文字ベクトル | string スカラー
アプリケーションの使用に関する追加要件についてのメモ。文字ベクトルまたは string スカラーとして指定します。
例: 'This is a Linux installer.'
データ型: char
| string
InstallerIcon
— アイコン イメージへのパス
文字ベクトル | string スカラー
インストールされるアプリケーションのアイコンとして使用するイメージ ファイルへのパス。文字ベクトルまたは string スカラーとして指定します。
既定のパスは次のとおりです。
'matlabroot
\toolbox\compiler\packagingResources\default_icon_48.ico'
例: 'D:\Documents\MATLAB\work\images\myIcon.ico'
InstallerLogo
— インストーラー イメージへのパス
文字ベクトル | string スカラー
インストーラーのロゴとして使用するイメージ ファイルへのパス。文字ベクトルまたは string スカラーとして指定します。ロゴのサイズは 150 x 340 ピクセルに変更されます。
既定のパスは次のとおりです。
'matlabroot
\toolbox\compiler\packagingResources\default_logo.ico'
例: 'D:\Documents\MATLAB\work\images\myLogo.ico'
InstallerName
— インストーラー ファイルの名前
MyAppInstaller
(既定値) | 文字ベクトル | string スカラー
インストーラー ファイルの名前。文字ベクトルまたは string スカラーとして指定します。拡張子は、関数が実行されるオペレーティング システムによって決まります。
例: 'MagicSquare_Installer'
InstallerSplash
— スプラッシュ スクリーン イメージへのパス
文字ベクトル | string スカラー
インストーラーのスプラッシュ スクリーンとして使用するイメージ ファイルへのパス。文字ベクトルまたは string スカラーとして指定します。スプラッシュ スクリーンのアイコンのサイズは 400 x 400 ピクセルに変更されます。
既定のパスは次のとおりです。
'matlabroot
\toolbox\toolbox\compiler\packagingResources\default_splash.ico'
例: 'D:\Documents\MATLAB\work\images\mySplash.ico'
OutputDir
— インストーラーの保存先フォルダーへのパス
文字ベクトル | string スカラー
インストーラーの保存先フォルダーへのパス。文字ベクトルまたは string スカラーとして指定します。
パスを指定しない場合、各オペレーティング システムの既定のパスは次のとおりです。
オペレーティング システム | 既定のインストール ディレクトリ |
---|---|
Windows | .\ |
Linux | ./ |
macOS | ./ |
上記のディレクトリ内の .
は、現在の作業ディレクトリを表します。
例: 'D:\Documents\MATLAB\work\MagicSquare'
RuntimeDelivery
— MATLAB Runtime の引き渡しオプション
'web'
(既定値) | 'installer'
インストールされるアプリケーションで MATLAB Runtime を使用可能にする方法の選択肢。
'web'
— アプリケーションのインストール時にインストーラーが MathWorks® の Web サイトから MATLAB Runtime をダウンロードするオプション。これは既定のオプションです。'installer'
— アプリケーションのインストール時に MathWorks Web サイトに接続せずにインストールできるように、インストーラー内に MATLAB Runtime を含めるオプション。エンド ユーザーがインターネットにアクセスできない可能性があると考えられる場合は、このオプションを使用します。
例: 'installer'
データ型: char
| string
Shortcut
— ショートカットへのパス
''
(既定値) | 文字ベクトル | string スカラー
インストール時にインストーラーがショートカットを作成するファイルまたはフォルダーへのパス。文字ベクトルまたは string スカラーとして指定します。
例: '.\mymagic.exe'
データ型: char
| string
Summary
— アプリケーションの概要説明
''
(既定値) | 文字ベクトル | string スカラー
アプリケーションの概要説明。文字ベクトルまたは string スカラーとして指定します。
例: 'Generates a magic square.'
データ型: char
| string
Version
— インストールされるアプリケーションのバージョン
'1.0'
(既定値) | 文字ベクトル | string スカラー
インストールされるアプリケーションのバージョン番号。文字ベクトルまたは string スカラーとして指定します。
例: '2.0'
データ型: char
| string
バージョン履歴
R2020a で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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)