Installer::Context Property
Gets or sets information about the current installation.
Assembly: System.Configuration.Install (in System.Configuration.Install.dll)
[BrowsableAttribute(false)] public: property InstallContext^ Context { InstallContext^ get (); void set (InstallContext^ value); }
Property Value
Type: System.Configuration.Install::InstallContextAn InstallContext that contains information about the current installation.
The Context 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 Context property with information that the methods need.
If an installer belongs to an installer collection, the parent installer sets the Context property before calling any of these methods. The parent installer can be accessed through the Parent property.
The following example demonstrates the Context property of the Installer class. The contents of the Context 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 : " ); IEnumerator^ myEnum = Context->Parameters->Keys->GetEnumerator(); while ( myEnum->MoveNext() ) { String^ myString = safe_cast<String^>(myEnum->Current); Console::WriteLine( Context->Parameters[ myString ] ); } }
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.