InstallContext.LogMessage メソッドとは何? わかりやすく解説 Weblio辞書 (original) (raw)

メッセージコンソールインストール ログ ファイル書き込みます

名前空間: System.Configuration.Install
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)
構文構文

Visual Basic (宣言)

Public Sub LogMessage ( _ message As String _ )

Visual Basic (使用法)

Dim instance As InstallContext Dim message As String

instance.LogMessage(message)

C#

public void LogMessage ( string message )

C++

public: void LogMessage ( String^ message )

J#

public void LogMessage ( String message )

JScript

public function LogMessage ( message : String )

パラメータ

message

書き込むメッセージ

解説解説

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

使用例使用例

この例は、InstallContext クラス概要紹介されているクラスの例からの抜粋です。

このサンプルでは、LogtoConsole パラメータ設定されているかどうか確認するために、IsParameterTrue メソッド使用しますyes場合、これは LogMessage メソッド使用してステータス メッセージインストール ログ ファイルコンソール書き込みます

Visual Basic

' 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

C#

// 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" ); }

C++

// 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" ); }

J#

// 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"); }

.NET Framework のセキュリティ.NET Frameworkセキュリティ

プラットフォームプラットフォーム

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.01.11.0

参照参照

関連項目
InstallContext クラス
InstallContext メンバ
System.Configuration.Install 名前空間
Parameters