Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

InstallerCollection::AddRange Method (InstallerCollection^)

 

Adds the specified collection of installers to this collection.

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

public:
void AddRange(
	InstallerCollection^ value
)

Parameters

value
Type: System.Configuration.Install::InstallerCollection^

An InstallerCollection 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 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 = gcnew TransactedInstaller;
TransactedInstaller^ myTransactedInstaller2 = gcnew TransactedInstaller;
AssemblyInstaller^ myAssemblyInstaller = gcnew AssemblyInstaller;
InstallContext^ myInstallContext;

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

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

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

// 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 );

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft