このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
MATLABCompilerによって生成されたファイル用のインストーラーの作成
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
からの結果を使用してスタンドアロン アプリケーションのインストーラーを作成し、名前と値の引数を使用してカスタマイズします。
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
を使用して、スタンドアロン アプリケーションのインストーラーを作成します。名前と値の引数を使用してインストーラー名を指定し、インストーラーにMATLAB Runtimeを含めます。
compiler.package.installer(results,...'InstallerName','MyMagicInstaller',...'RuntimeDelivery','installer');
magicsquareinstaller
というフォルダー内にMyMagicInstaller
というインストーラーを生成します。
関数compiler.build.standaloneApplication
からの結果を使用して、Windows®システムでスタンドアロン アプリケーションのインストーラーを作成します。InstallerOptions
オブジェクトを使用してインストーラーをカスタマイズします。
MATLAB で、スタンドアロン アプリケーションとして配布する MATLAB コードを見つけます。この例では、
にあるファイル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\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_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
という名前のファイルに保存します。
functionout = mymagic(in) out = magic(in)
mcc
コマンドを使用して、スタンドアロン アプリケーションをビルドします。
mcc-mmymagic.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
というインストーラーが生成されます。
名前と値の引数を使用して、Windows システムでスタンドアロン アプリケーションのインストーラーをカスタマイズします。
compiler.package.installer('mymagic.exe','requiredMCRProducts.txt',...'ApplicationName','MagicSquare_Generator',...'AuthorCompany','Boston Common',...'AuthorName','Frog',...'InstallerName','MagicSquare_Installer',...'Summary','Generates a magic square.')
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\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'
InstallerOptions
オブジェクトを入力として関数に渡します。
compiler.package.installer('mymagic.exe','requiredMCRProducts.txt','Options',opts)
results
—ビルド結果オブジェクトResults
オブジェクトビルド結果。compiler.build.Results
オブジェクトとして指定します。関数compiler.build
からの出力を保存することで、Results
オブジェクトを作成します。
files
—インストール用のファイルとフォルダーのリストインストール用のファイルとフォルダーのリスト。文字ベクトル、string スカラー、文字ベクトルの cell 配列、または string 配列として指定します。これらのファイルは、通常、mcc
コマンドまたは関数compiler.build
によって生成され、インストールされるアプリケーションの実行に必要な追加のファイルおよびフォルダーも含めることができます。
特定のリリースで生成されたファイルは、同じリリースの関数compiler.package.installer
を使用してパッケージ化できます。
あるオペレーティング システム上のタイプ.ctf
のファイルは、別のオペレーティング システムで関数compiler.package.installer
を使用してパッケージ化できます。ただし、ビルド コマンドと関数compiler.package.installer
のリリースが同じである場合に限られます。
例:'mymagic.exe'
データ型:char
|string
filePath
—requiredMCRProducts.txt
ファイルへのパスMATLABCompiler™によって生成されたrequiredMCRProducts.txt
ファイルへのパス。
例:'D:\Documents\MATLAB\work\MagicSquare\requiredMCRProducts.txt'
データ型:char
|string
appName
—インストールされるアプリケーションの名前インストールされるアプリケーションの名前。文字ベクトルまたは string スカラーとして指定します。
例:'MagicSquare_Generator'
データ型:char
|string
opts
—InstallerOptions オブジェクトInstallerOptions
オブジェクトインストーラー オプション。InstallerOptions
オブジェクトとして指定します。
オプションのName,Value
のペアの引数をコンマ区切りで指定します。Name
は引数名で、Value
は対応する値です。Name
は引用符で囲まなければなりません。Name1,Value1,...,NameN,ValueN
のように、複数の名前と値のペアの引数を任意の順序で指定できます。
'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 スカラーとして指定します。
パスを指定しない場合、各オペレーティング システムの既定のパスは次のとおりです。
オペレーティング システム | 既定のインストール ディレクトリ |
---|---|
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 スカラーアプリケーションの使用に関する追加要件についてのメモ。文字ベクトルまたは字符串スカラーとして指定します。
例:'This is a Linux installer.'
データ型:char
|string
InstallerIcon
—アイコン イメージへのパスインストールされるアプリケーションのアイコンとして使用するイメージ ファイルへのパス。文字ベクトルまたは string スカラーとして指定します。
既定のパスは次のとおりです。
'matlabroot
\toolbox\compiler\resources\default_icon_48.png'
例:'D:\Documents\MATLAB\work\images\myIcon.png'
InstallerLogo
—インストーラー イメージへのパスインストーラーのロゴとして使用するイメージ ファイルへのパス。文字ベクトルまたは string スカラーとして指定します。ロゴのサイズは 150 x 340 ピクセルに変更されます。
既定のパスは次のとおりです。
'matlabroot
\toolbox\compiler\resources\default_logo.png'
例:'D:\Documents\MATLAB\work\images\myLogo.png'
InstallerName
—インストーラー ファイルの名前MyAppInstaller
(既定値) |文字ベクトル|string スカラーインストーラー ファイルの名前。文字ベクトルまたは string スカラーとして指定します。拡張子は、関数が実行されるオペレーティング システムによって決まります。
例:'MagicSquare_Installer'
InstallerSplash
—スプラッシュ スクリーン イメージへのパスインストーラーのスプラッシュ スクリーンとして使用するイメージ ファイルへのパス。文字ベクトルまたは string スカラーとして指定します。スプラッシュ スクリーンのアイコンのサイズは 400 x 400 ピクセルに変更されます。
既定のパスは次のとおりです。
'matlabroot
\toolbox\toolbox\compiler\resources\default_splash.png'
例:'D:\Documents\MATLAB\work\images\mySplash.png'
OutputDir
—インストーラーの保存先フォルダーへのパスインストーラーの保存先フォルダーへのパス。文字ベクトルまたは 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
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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:.
Selectweb siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.