InstallerCollection.AddRange Method (InstallerCollection)
Adds the specified collection of installers to this collection.
Assembly: System.Configuration.Install (in System.Configuration.Install.dll)
The following example demonstrates the Insert method and the AddRange methods of the InstallerCollection class. It creates AssemblyInstaller instances for MyAssembly1.exe and MyAssembly2.exe. These instances of AssemblyInstaller are added to a TransactedInstaller named myTransactedInstaller1. The installers in the myTransactedInstaller1 are copied to another TransactedInstaller named myTransactedInstaller2. The installation process installs both MyAssembly1.exe and MyAssembly2.exe.
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);
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.