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

比較対象のインストーラー。

戻り値

対象となるインストーラーと otherInstaller パラメーターで指定されたインストーラーが同じオブジェクトをインストールする場合は true。それ以外の場合は false

次の例では、 クラス MyInstallClassを定義します。これにより、イベント ログが作成され、イベント ログ コンポーネントのプロパティが オブジェクトに EventLogInstaller コピーされます。 また、オブジェクトが と同じ種類のインストールEventLogInstallerを処理できるかどうかをServiceInstaller確認します。

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

注釈

通常、 はtrueIsEquivalentInstallerこのインストーラーと パラメーターで指定されたインストーラーが同じオブジェクトをotherInstallerインストールする場合にのみ を返します。 このような場合、いずれかのインストーラーで または Uninstall メソッドをInstall呼び出すと、同じシステム状態になります。

適用対象