InstallContext.LogMessage メソッド
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)


インストーラは、このメソッドを呼び出して、進行状況などのステータス情報をログ ファイルに書き込むことができます。コマンド ライン パラメータでユーザー インターフェイスを表示するように指定されている場合、インストーラは LogMessage メソッドを呼び出すだけでなく、メッセージ ボックスを表示したりクエリを実行したりする必要もあります。インストールの実行に InstallUtil.exe が使用され、コマンド ラインで "/LogToConsole= true" が指定されている場合を除いて、ログ ファイルに書き込まれるテキストがユーザーに表示されることはありません。

この例は、InstallContext クラスの概要で紹介されているクラスの例からの抜粋です。
このサンプルでは、LogtoConsole パラメータが設定されているかどうかを確認するために、IsParameterTrue メソッドを使用します。yes の場合、これは LogMessage メソッドを使用してステータス メッセージをインストール ログ ファイルとコンソールに書き込みます。
' Check wether the "LogtoConsole" parameter has been set. If myInstallContext.IsParameterTrue("LogtoConsole") = True Then ' Display the message to the console and add it to the logfile. myInstallContext.LogMessage("The 'Install' method has been called") End If
// Check whether the "LogtoConsole" parameter has been set. if( myInstallContext.IsParameterTrue( "LogtoConsole" ) == true ) { // Display the message to the console and add it to the logfile. myInstallContext.LogMessage( "The 'Install' method has been called" ); }


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からInstallContext.LogMessage メソッドを検索する場合は、下記のリンクをクリックしてください。

- InstallContext.LogMessage メソッドのページへのリンク