次の方法で共有


Installer.Installers プロパティ

インストーラが格納しているインストーラのコレクションを取得します。

Public ReadOnly Property Installers As InstallerCollection
[C#]
public InstallerCollection Installers {get;}
[C++]
public: __property InstallerCollection* get_Installers();
[JScript]
public function get Installers() : InstallerCollection;

プロパティ値

インストーラに関連付けられているインストーラのコレクションを格納している InstallerCollection

解説

Installers プロパティは、 Installer のインスタンスがコンポーネントを正しくインストールするために必要なオブジェクトをインストールするインストーラのコレクションを格納します。 Installer クラスの InstallCommitRollbackUninstall の各メソッドは、コレクション内のインストーラに順次アクセスし、各インストーラに対応するメソッドを呼び出します。

Installer のインスタンスがインストーラ コレクションに含まれている場合、 Parent プロパティは、そのコレクションを格納する Installer インスタンスになります。 Installers コレクションの使用例については、 AssemblyInstaller クラスのトピックを参照してください。

使用例

[Visual Basic, C#, C++] Installers プロパティおよび Parent プロパティの例を次に示します。 Installers プロパティは、 Installer に関連付けられている InstallerCollection を表示します。

 
Dim myAssemblyInstaller As New AssemblyInstaller()
Dim myServiceInstaller As New ServiceInstaller()
Dim myEventLogInstaller As New EventLogInstaller()
Dim myInstallerCollection As InstallerCollection = _
                                       myAssemblyInstaller.Installers

' Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection.Add(myServiceInstaller)
myInstallerCollection.Add(myEventLogInstaller)

Dim myInstaller(1) As Installer
myInstallerCollection.CopyTo(myInstaller, 0)
' Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
Console.WriteLine("Installers in the InstallerCollection : ")
Dim iIndex As Integer
For iIndex = 0 To myInstaller.Length - 1
   Console.WriteLine(myInstaller(iIndex).ToString())
Next iIndex

[C#] 
AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
ServiceInstaller myServiceInstaller = new ServiceInstaller();
EventLogInstaller myEventLogInstaller = new EventLogInstaller();

InstallerCollection myInstallerCollection = myAssemblyInstaller.Installers;

// Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection.Add(myServiceInstaller);
myInstallerCollection.Add(myEventLogInstaller);

Installer[] myInstaller = new Installer[2];
myInstallerCollection.CopyTo(myInstaller,0);
// Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
Console.WriteLine("Installers in the InstallerCollection : ");
for (int iIndex=0; iIndex < myInstaller.Length; iIndex++)
   Console.WriteLine(myInstaller[iIndex].ToString());

[C++] 
AssemblyInstaller* myAssemblyInstaller = new AssemblyInstaller();
ServiceInstaller* myServiceInstaller = new ServiceInstaller();
EventLogInstaller* myEventLogInstaller = new EventLogInstaller();

InstallerCollection* myInstallerCollection = myAssemblyInstaller->Installers;

// Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection->Add(myServiceInstaller);
myInstallerCollection->Add(myEventLogInstaller);

Installer* myInstaller[] = new Installer*[2];
myInstallerCollection->CopyTo(myInstaller, 0);
// Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
Console::WriteLine(S"Installers in the InstallerCollection : ");
for (int iIndex=0; iIndex < myInstaller->Length; iIndex++)
    Console::WriteLine(myInstaller[iIndex]);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

.NET Framework セキュリティ:

参照

Installer クラス | Installer メンバ | System.Configuration.Install 名前空間 | AssemblyInstaller | Commit | ComponentInstaller | Install | InstallerCollection | Parent | Rollback | TransactedInstaller | Uninstall