Installer.Installers 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得這個安裝程式包含的安裝程式集合。
public:
property System::Configuration::Install::InstallerCollection ^ Installers { System::Configuration::Install::InstallerCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Configuration.Install.InstallerCollection Installers { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Installers : System.Configuration.Install.InstallerCollection
Public ReadOnly Property Installers As InstallerCollection
屬性值
InstallerCollection,包含與這個安裝程式相關聯的安裝程式集合。
- 屬性
範例
下列範例示範 Installers 和 Parent 屬性。 屬性 Installers 會顯示 InstallerCollection 與 Installer相關聯的 。
AssemblyInstaller^ myAssemblyInstaller = gcnew AssemblyInstaller;
ServiceInstaller^ myServiceInstaller = gcnew ServiceInstaller;
EventLogInstaller^ myEventLogInstaller = gcnew EventLogInstaller;
InstallerCollection^ myInstallerCollection = myAssemblyInstaller->Installers;
// Add Installers to the InstallerCollection of 'myAssemblyInstaller'.
myInstallerCollection->Add( myServiceInstaller );
myInstallerCollection->Add( myEventLogInstaller );
array<Installer^>^ myInstaller = gcnew array<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() );
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());
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
備註
屬性 Installers 包含安裝程式的集合,這些安裝程式會安裝這個 Installer 實例所需的物件,以正確安裝元件。 類別Install的 Installer 、 RollbackCommit和 Uninstall 方法會經歷安裝程式的集合,並叫用每個安裝程序的對應方法。
如果 這個實體 Installer 包含在安裝程式集合中,則 Parent 屬性是 Installer 包含集合的實例。 如需使用集合的 Installers 範例,請參閱 AssemblyInstaller 類別。