ComponentInstaller.IsEquivalentInstaller(ComponentInstaller) Метод
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Определяет, устанавливает ли указанный установщик тот же объект, что и этот установщик.
public:
virtual bool IsEquivalentInstaller(System::Configuration::Install::ComponentInstaller ^ otherInstaller);
public virtual bool IsEquivalentInstaller(System.Configuration.Install.ComponentInstaller otherInstaller);
abstract member IsEquivalentInstaller : System.Configuration.Install.ComponentInstaller -> bool
override this.IsEquivalentInstaller : System.Configuration.Install.ComponentInstaller -> bool
Public Overridable Function IsEquivalentInstaller (otherInstaller As ComponentInstaller) As Boolean
Параметры
- otherInstaller
- ComponentInstaller
Установщик для сравнения.
Возвращаемое значение
true Значение , если этот установщик и установщик, указанный параметром otherInstaller , устанавливают тот же объект; в противном случае false.
Примеры
В следующем примере определяется класс MyInstallClass, который создает журнал событий и копирует свойства компонента журнала событий в EventLogInstaller объект. Он также проверяет, может ли ServiceInstaller объект обрабатывать тот же тип установки, что EventLogInstallerи .
ServiceInstaller^ myServiceInstaller = gcnew 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'" );
}
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'");
}
Dim myServiceInstaller As New ServiceInstaller()
' Check whether 'ServiceInstaller' object can handle the same
' kind of installation as 'EventLogInstaller' object.
If myEventLogInstaller.IsEquivalentInstaller(myServiceInstaller) Then
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'")
End If
Комментарии
Как правило, возвращается IsEquivalentInstaller только в том случае, если этот установщик и установщик, указанный параметромtrue, otherInstaller устанавливают тот же объект. В таком случае вызов Install или Uninstall метод в любом установщике приводит к тому же состоянию системы.