InstallException Constructor ()

 

Initializes a new instance of the InstallException class.

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

public:
InstallException()

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.

System_CAPS_noteNote

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
Return to top
Show: