次の方法で共有


InstallerCollection.Insert メソッド

コレクション内の指定したインデックスに、指定したインストーラを挿入します。

Public Sub Insert( _
   ByVal index As Integer, _   ByVal value As Installer _)
[C#]
public void Insert(intindex,Installervalue);
[C++]
public: void Insert(intindex,Installer* value);
[JScript]
public function Insert(
   index : int,value : Installer);

パラメータ

  • index
    インストーラを挿入する位置を示す 0 から始まるインデックス。
  • value
    挿入する Installer

使用例

[Visual Basic, C#, C++] 次の例は、 AddRange メソッドの例と同じです。この例の詳細については、 AddRange メソッドの例を参照してください。

 
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 名前空間