InstallException Constructor (String^)
.NET Framework (current version)
Initializes a new instance of the InstallException class, and specifies the message to display to the user.
Assembly: System.Configuration.Install (in System.Configuration.Install.dll)
Parameters
- message
-
Type:
System::String^
The message to display to the user.
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 Uninstall method. Uninstallation will only happen if a file named FileDoesNotExist.txt exists. Otherwise it 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 Uninstall( IDictionary^ savedState ) override { Installer::Uninstall( savedState ); Console::WriteLine( "UnInstall ..." ); // Throw an error if a particular file doesn't exist. if ( !File::Exists( "FileDoesNotExist.txt" ) ) throw gcnew InstallException( "The file 'FileDoesNotExist' does not exist" ); // Perform the uninstall activites if the file exists. }
.NET Framework
Available since 1.1
Available since 1.1
Show:
