InstallException Constructor ()
.NET Framework (current version)
Initializes a new instance of the InstallException class.
Assembly: System.Configuration.Install (in System.Configuration.Install.dll)
The following example demonstrates the InstallException constructor. It is a part of the example of the InstallException class.
In this example, Installutil.exe calls the Commit method. The code in Commit presumes that a file named FileDoesNotExist.txt exists before the installation of the assembly can be committed. If the file FileDoesNotExist.txt does not exist, Commit raises an InstallException.
Note |
|---|
This example shows how to use one of the overloaded versions of the InstallException constructor. For other examples that might be available, see the individual overload topics. |
virtual void Commit( IDictionary^ savedState ) override { Installer::Commit( savedState ); Console::WriteLine( "Commit ..." ); // Throw an error if a particular file doesn't exist. if ( !File::Exists( "FileDoesNotExist.txt" ) ) throw gcnew InstallException; // Perform the final installation if the file exists. }
.NET Framework
Available since 1.1
Available since 1.1
Show:
