Export (0) Print
Expand All

Installer.Installers Property

Gets the collection of installers that this installer contains.

[Visual Basic]
Public ReadOnly Property Installers As InstallerCollection
[C#]
public InstallerCollection Installers {get;}
[C++]
public: __property InstallerCollection* get_Installers();
[JScript]
public function get Installers() : InstallerCollection;

Property Value

An InstallerCollection containing the collection of installers associated with this installer.

Remarks

The Installers property contains a collection of installers that install objects needed by this Installer instance to correctly install the component. The Install, Commit, Rollback, and Uninstall methods of the Installer class go through the collection of installers and invokes the corresponding method of each installer.

If this instance of Installer is contained in an installer collection, the Parent property is the Installer instance that contains the collection. For an example of the use of the Installers collection, see the AssemblyInstaller class.

Example

[Visual Basic, C#, C++] The following example demonstrates the Installers and Parent properties. The Installers property shows the InstallerCollection associated with an Installer.

[Visual Basic] 
Dim myAssemblyInstaller As New AssemblyInstaller()
Dim myServiceInstaller As New ServiceInstaller()
Dim myEventLogInstaller As New EventLogInstaller()
Dim myInstallerCollection As InstallerCollection = _
                                       myAssemblyInstaller.Installers

' Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection.Add(myServiceInstaller)
myInstallerCollection.Add(myEventLogInstaller)

Dim myInstaller(1) As Installer
myInstallerCollection.CopyTo(myInstaller, 0)
' Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
Console.WriteLine("Installers in the InstallerCollection : ")
Dim iIndex As Integer
For iIndex = 0 To myInstaller.Length - 1
   Console.WriteLine(myInstaller(iIndex).ToString())
Next iIndex

[C#] 
AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
ServiceInstaller myServiceInstaller = new ServiceInstaller();
EventLogInstaller myEventLogInstaller = new EventLogInstaller();

InstallerCollection myInstallerCollection = myAssemblyInstaller.Installers;

// Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection.Add(myServiceInstaller);
myInstallerCollection.Add(myEventLogInstaller);

Installer[] myInstaller = new Installer[2];
myInstallerCollection.CopyTo(myInstaller,0);
// Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
Console.WriteLine("Installers in the InstallerCollection : ");
for (int iIndex=0; iIndex < myInstaller.Length; iIndex++)
   Console.WriteLine(myInstaller[iIndex].ToString());

[C++] 
AssemblyInstaller* myAssemblyInstaller = new AssemblyInstaller();
ServiceInstaller* myServiceInstaller = new ServiceInstaller();
EventLogInstaller* myEventLogInstaller = new EventLogInstaller();

InstallerCollection* myInstallerCollection = myAssemblyInstaller->Installers;

// Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection->Add(myServiceInstaller);
myInstallerCollection->Add(myEventLogInstaller);

Installer* myInstaller[] = new Installer*[2];
myInstallerCollection->CopyTo(myInstaller, 0);
// Show the contents of the InstallerCollection of 'myAssemblyInstaller'.
Console::WriteLine(S"Installers in the InstallerCollection : ");
for (int iIndex=0; iIndex < myInstaller->Length; iIndex++)
    Console::WriteLine(myInstaller[iIndex]);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Installer Class | Installer Members | System.Configuration.Install Namespace | AssemblyInstaller | Commit | ComponentInstaller | Install | InstallerCollection | Parent | Rollback | TransactedInstaller | Uninstall

Show:
© 2014 Microsoft