ComponentInstaller.IsEquivalentInstaller(ComponentInstaller) Method

Definition

Determines if the specified installer installs the same object as this installer.

C#
public virtual bool IsEquivalentInstaller(System.Configuration.Install.ComponentInstaller otherInstaller);

Parameters

otherInstaller
ComponentInstaller

The installer to compare.

Returns

true if this installer and the installer specified by the otherInstaller parameter install the same object; otherwise, false.

Examples

The following example defines a class MyInstallClass, which creates the event log and copies the properties of the event log component to the EventLogInstaller object. It also checks whether ServiceInstaller object can handle the same kind of installation as EventLogInstaller.

C#
ServiceInstaller myServiceInstaller = new  ServiceInstaller();
// Check whether 'ServiceInstaller' object can handle the same
// kind of installation as 'EventLogInstaller' object.
if(myEventLogInstaller.IsEquivalentInstaller(myServiceInstaller))
{
   Console.WriteLine("'ServiceInstaller' can handle the same kind"
                     +" of installation as EventLogInstaller");
}
else
{
    Console.WriteLine("'ServiceInstaller' can't handle the same"
                 +" kind of installation as 'EventLogInstaller'");
}

Remarks

Typically, IsEquivalentInstaller returns true only if this installer and the installer specified by the otherInstaller parameter install the same object. In such a case, calling the Install or Uninstall method on either installer results in the same system state.

Applies to

Продукт Версії
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1