Gets or sets information about the current installation.

Namespace:   System.Configuration.Install
Assembly:  System.Configuration.Install (in System.Configuration.Install.dll)

[BrowsableAttribute(false)]
public InstallContext Context { get; set; }
public:
[BrowsableAttribute(false)]
property InstallContext^ Context {
	InstallContext^ get();
	void set(InstallContext^ value);
}
[<BrowsableAttribute(false)>]
member Context : InstallContext with get, set
<BrowsableAttribute(False)>
Public Property Context As InstallContext

Property Value

Type:

An InstallContext that contains information about the current installation.

The property contains installation information. For example, information about the location of the log file for the installation, the location of the file to save information required by the Uninstall method, and the command line that was entered when the installation executable was run.

The program that calls the Install, Commit, Rollback, or Uninstall methods sets the property with information that the methods need.

If an installer belongs to an installer collection, the parent installer sets the property before calling any of these methods. The parent installer can be accessed through the property.

The following example demonstrates the property of the Installer class. The contents of the property contain information about the location of the log file for the installation, the location of the file to save information required by the Uninstall method, and the command line that was entered when the installation executable was run. These contents are then displayed on the console.

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
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 ] );
   }
}
.NET Framework
Available since 1.1
Return to top