InstallerCollection.AddRange Method (Installer[])

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Adds the specified array of installers to this collection.

Namespace:   System.Configuration.Install
Assembly:  System.Configuration.Install (in System.Configuration.Install.dll)

public void AddRange(
	Installer[] value
)

Parameters

value
Type: System.Configuration.Install.Installer[]

An array of type Installer that represents the installers to add to this collection.

The Parent property of each added Installer is set to the Installer containing this collection.

The following example demonstrates the AddRange method of the InstallerCollection class. It creates AssemblyInstaller instances for MyAssembly1.exe and MyAssembly2.exe.These instances are added to a TransactedInstaller. The installation process installs both MyAssembly1.exe and MyAssembly2.exe.

ArrayList myInstallers =new ArrayList();
TransactedInstaller myTransactedInstaller = new TransactedInstaller();
AssemblyInstaller myAssemblyInstaller;
InstallContext myInstallContext;

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

// Add the instance of 'AssemblyInstaller' to the list of installers.  
myInstallers.Add(myAssemblyInstaller);

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

// Add the instance of 'AssemblyInstaller' to the list of installers.  
myInstallers.Add(myAssemblyInstaller);

// Add the installers to the 'TransactedInstaller' instance.
myTransactedInstaller.Installers.AddRange((Installer[])myInstallers.ToArray(typeof(Installer)));

.NET Framework
Available since 1.1
Return to top
Show: