Installer.Context プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
現在のインストールに関する情報を取得または設定します。
public:
property System::Configuration::Install::InstallContext ^ Context { System::Configuration::Install::InstallContext ^ get(); void set(System::Configuration::Install::InstallContext ^ value); };
[System.ComponentModel.Browsable(false)]
public System.Configuration.Install.InstallContext Context { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.Context : System.Configuration.Install.InstallContext with get, set
Public Property Context As InstallContext
プロパティ値
現在のインストールに関する情報を格納している InstallContext。
- 属性
例
次の例では、 クラスの Context プロパティを Installer 示します。 プロパティの Context 内容には、インストール用のログ ファイルの場所、メソッドで Uninstall 必要な情報を保存するファイルの場所、およびインストール実行可能ファイルの実行時に入力されたコマンド ラインに関する情報が含まれます。 その後、これらの内容がコンソールに表示されます。
StringDictionary^ myStringDictionary = Context->Parameters;
if ( Context->Parameters->Count > 0 )
{
Console::WriteLine( "Context Property : " );
IEnumerator^ myEnum = Context->Parameters->Keys->GetEnumerator();
while ( myEnum->MoveNext() )
{
String^ myString = safe_cast<String^>(myEnum->Current);
Console::WriteLine( Context->Parameters[ myString ] );
}
}
StringDictionary myStringDictionary = Context.Parameters;
if ( Context.Parameters.Count > 0 )
{
Console.WriteLine("Context Property : " );
foreach( string myString in Context.Parameters.Keys)
{
Console.WriteLine( Context.Parameters[ myString ] );
}
}
Dim myStringDictionary As StringDictionary = Context.Parameters
If Context.Parameters.Count > 0 Then
Console.WriteLine("Context Property : ")
Dim myString As String
For Each myString In Context.Parameters.Keys
Console.WriteLine(Context.Parameters(myString))
Next myString
End If
注釈
Contextプロパティには、インストール情報が含まれています。 たとえば、インストールのログ ファイルの場所、メソッドで Uninstall 必要な情報を保存するファイルの場所、インストール実行可能ファイルの実行時に入力されたコマンド ラインに関する情報などです。
、、、または Uninstall メソッドをInstall呼び出すプログラムは、メソッドにContext必要な情報を使用して プロパティを設定RollbackCommitします。
インストーラーがインストーラーコレクションに属している場合、親インストーラーは、 これらのメソッドのいずれかを呼び出す前にContextプロパティを設定します。 親インストーラーにはParentプロパティを使用してアクセスできます。