InstallException クラスの新しいインスタンスを初期化し、ユーザーに表示するメッセージを指定します。
名前空間: System.Configuration.Install
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)
構文
'宣言
Public Sub New ( _
message As String _
)
'使用
Dim message As String
Dim instance As New InstallException(message)
public InstallException (
string message
)
public:
InstallException (
String^ message
)
public InstallException (
String message
)
public function InstallException (
message : String
)
パラメータ
- message
ユーザーに表示するメッセージ。
使用例
InstallException コンストラクタの例を次に示します。これは、InstallException クラスの例の一部です。
この例では、Installutil.exe が Uninstall メソッドを呼び出します。アンインストールは、FileDoesNotExist.txt
という名前のファイルが存在する場合にだけ行われます。それ以外の場合は、InstallException が発生します。
注意
InstallException コンストラクタのオーバーロードされたバージョンのいずれかの使用方法を次の例に示します。その他の例については、個々のオーバーロードのトピックを参照してください。
Public Overrides Sub Uninstall(savedState As IDictionary)
MyBase.Uninstall(savedState)
Console.WriteLine("UnInstall ...")
' Throw an error if a particular file doesn't exist.
If Not File.Exists("FileDoesNotExist.txt") Then
Throw New InstallException("The file 'FileDoesNotExist'" + " does not exist")
End If
' Perform the uninstall activites if the file exists.
End Sub
public override void Uninstall(IDictionary savedState)
{
base.Uninstall(savedState);
Console.WriteLine("UnInstall ...");
// Throw an error if a particular file doesn't exist.
if(!File.Exists("FileDoesNotExist.txt"))
throw new InstallException("The file 'FileDoesNotExist'" +
" does not exist");
// Perform the uninstall activites if the file exists.
}
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.
}
public void Uninstall(IDictionary savedState)
throws System.Configuration.Install.InstallException
{
super.Uninstall(savedState);
Console.WriteLine("UnInstall ...");
// Throw an error if a particular file doesn't exist.
if (!(File.Exists("FileDoesNotExist.txt"))) {
throw new InstallException("The file 'FileDoesNotExist'"
+ " does not exist");
}
} //Uninstall
.NET Framework のセキュリティ
- 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「」を参照してください。
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 2.0、1.1、1.0
参照
関連項目
InstallException クラス
InstallException メンバ
System.Configuration.Install 名前空間