次の方法で共有


InstallerCollection.AddRange メソッド (InstallerCollection)

コレクションに、指定したインストーラ コレクションを追加します。

Overloads Public Sub AddRange( _
   ByVal value As InstallerCollection _)
[C#]
public void AddRange(InstallerCollectionvalue);
[C++]
public: void AddRange(InstallerCollection* value);
[JScript]
public function AddRange(
   value : InstallerCollection);

パラメータ

解説

追加された各 InstallerParent プロパティには、追加先のコレクションを格納している Installer が設定されます。

使用例

[Visual Basic, C#, C++] InstallerCollection クラスの Insert メソッドと AddRange メソッドの例を次に示します。これは MyAssembly1.exe および MyAssembly2.exeAssemblyInstaller インスタンスを作成します。これらの AssemblyInstaller のインスタンスは、 myTransactedInstaller1 という名前の TransactedInstaller に追加されます。 myTransactedInstaller1 のインストーラは、 myTransactedInstaller2 という名前の別の TransactedInstaller にコピーされます。インストール プロセスによって、 MyAssembly1.exeMyAssembly2.exe の両方がインストールされます。

 
Dim myTransactedInstaller1 As New TransactedInstaller()
Dim myTransactedInstaller2 As New TransactedInstaller()
Dim myAssemblyInstaller As New AssemblyInstaller()
Dim myInstallContext As InstallContext

' Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller = New AssemblyInstaller("MyAssembly1.exe", Nothing)

' Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller1.Installers.Insert(0, myAssemblyInstaller)

' Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller = New AssemblyInstaller("MyAssembly2.exe", Nothing)

' Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller1.Installers.Insert(1, myAssemblyInstaller)

' Copy the installers of 'myTransactedInstaller1' to 'myTransactedInstaller2'.
myTransactedInstaller2.Installers.AddRange(myTransactedInstaller1.Installers)


[C#] 
TransactedInstaller myTransactedInstaller1 = new TransactedInstaller();
TransactedInstaller myTransactedInstaller2 = new TransactedInstaller();
AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
InstallContext myInstallContext;

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller = 
   new AssemblyInstaller("MyAssembly1.exe", null);

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller1.Installers.Insert(0, myAssemblyInstaller);

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller = 
   new AssemblyInstaller("MyAssembly2.exe", null);

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller1.Installers.Insert(1, myAssemblyInstaller);

// Copy the installers of 'myTransactedInstaller1' to 'myTransactedInstaller2'.
myTransactedInstaller2.Installers.AddRange(myTransactedInstaller1.Installers);


[C++] 
TransactedInstaller* myTransactedInstaller1 = new TransactedInstaller();
TransactedInstaller* myTransactedInstaller2 = new TransactedInstaller();
AssemblyInstaller* myAssemblyInstaller = new AssemblyInstaller();
InstallContext* myInstallContext;

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly1.exe'.
myAssemblyInstaller = new AssemblyInstaller(S"MyAssembly1.exe", 0);

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller1->Installers->Insert(0, myAssemblyInstaller);

// Create a instance of 'AssemblyInstaller' that installs 'MyAssembly2.exe'.
myAssemblyInstaller = new AssemblyInstaller(S"MyAssembly2.exe", 0);

// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller1->Installers->Insert(1, myAssemblyInstaller);

// Copy the installers of 'myTransactedInstaller1' to 'myTransactedInstaller2'.
myTransactedInstaller2->Installers->AddRange(myTransactedInstaller1->Installers);

[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 セキュリティ:

参照

InstallerCollection クラス | InstallerCollection メンバ | System.Configuration.Install 名前空間 | InstallerCollection.AddRange オーバーロードの一覧 | Add | Remove | Installer