InstallContext.LogMessage メソッドとは何? わかりやすく解説 Weblio辞書 (original) (raw)
メッセージをコンソールとインストール ログ ファイルに書き込みます。
名前空間: System.Configuration.Install
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)
構文
Public Sub LogMessage ( _ message As String _ )
Dim instance As InstallContext Dim message As String
instance.LogMessage(message)
public void LogMessage ( string message )
public: void LogMessage ( String^ message )
public void LogMessage ( String message )
public function LogMessage ( message : String )
インストーラは、このメソッドを呼び出して、進行状況などのステータス情報をログ ファイルに書き込むことができます。コマンド ライン パラメータでユーザー インターフェイスを表示するように指定されている場合、インストーラは 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" ); }
// Check whether the "LogtoConsole" parameter has been set. if ( myInstallContext->IsParameterTrue( "LogtoConsole" ) ) { // Display the message to the console and add it to the logfile. myInstallContext->LogMessage( "The 'Install' method has been called" ); }
// 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
.NET Framework
サポート対象 : 2.0、1.1、1.0
関連項目
InstallContext クラス
InstallContext メンバ
System.Configuration.Install 名前空間
Parameters