AssemblyInstaller クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
アセンブリを読み込み、そのアセンブリ内ですべてのインストーラーを実行します。
public ref class AssemblyInstaller : System::Configuration::Install::Installer
public class AssemblyInstaller : System.Configuration.Install.Installer
type AssemblyInstaller = class
inherit Installer
Public Class AssemblyInstaller
Inherits Installer
- 継承
例
次の例では、 コンストラクターを AssemblyInstaller 呼び出すことによって が AssemblyInstaller 作成されます。 このオブジェクトのプロパティが設定され、 Install メソッドと Commit メソッドが呼び出されてアセンブリが MyAssembly.exe インストールされます。
#using <System.dll>
#using <System.Configuration.Install.dll>
using namespace System;
using namespace System::Configuration::Install;
using namespace System::Collections;
using namespace System::Collections::Specialized;
int main()
{
IDictionary^ mySavedState = gcnew Hashtable;
Console::WriteLine( "" );
try
{
// Set the commandline argument array for 'logfile'.
array<String^>^commandLineOptions = {"/LogFile=example.log"};
// Create an object of the 'AssemblyInstaller' class.
AssemblyInstaller^ myAssemblyInstaller = gcnew AssemblyInstaller(
"MyAssembly.exe", commandLineOptions );
myAssemblyInstaller->UseNewContext = true;
// Install the 'MyAssembly' assembly.
myAssemblyInstaller->Install( mySavedState );
// Commit the 'MyAssembly' assembly.
myAssemblyInstaller->Commit( mySavedState );
}
catch ( Exception^ e )
{
Console::WriteLine( e->Message );
}
}
using System;
using System.Configuration.Install;
using System.Collections;
using System.Collections.Specialized;
class AssemblyInstaller_Example
{
static void Main()
{
IDictionary mySavedState = new Hashtable();
Console.WriteLine( "" );
try
{
// Set the commandline argument array for 'logfile'.
string[] commandLineOptions = new string[ 1 ] {"/LogFile=example.log"};
// Create an object of the 'AssemblyInstaller' class.
AssemblyInstaller myAssemblyInstaller = new
AssemblyInstaller( "MyAssembly.exe" , commandLineOptions );
myAssemblyInstaller.UseNewContext = true;
// Install the 'MyAssembly' assembly.
myAssemblyInstaller.Install( mySavedState );
// Commit the 'MyAssembly' assembly.
myAssemblyInstaller.Commit( mySavedState );
}
catch (Exception e)
{
Console.WriteLine( e.Message );
}
}
}
Imports System.Configuration.Install
Imports System.Collections
Imports System.Collections.Specialized
Class AssemblyInstaller_Example
Shared Sub Main()
Dim mySavedState = New Hashtable()
Console.WriteLine("")
Try
' Set the commandline argument array for 'logfile'.
Dim commandLineOptions(0) As String
commandLineOptions(0) = "/LogFile=example.log"
' Create an object of the 'AssemblyInstaller' class.
Dim myAssemblyInstaller As _
New AssemblyInstaller("MyAssembly.exe", commandLineOptions)
myAssemblyInstaller.UseNewContext = True
' Install the 'MyAssembly' assembly.
myAssemblyInstaller.Install(mySavedState)
' Commit the 'MyAssembly' assembly.
myAssemblyInstaller.Commit(mySavedState)
Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub
End Class
コンストラクター
| AssemblyInstaller() |
AssemblyInstaller クラスの新しいインスタンスを初期化します。 |
| AssemblyInstaller(Assembly, String[]) |
AssemblyInstaller クラスの新しいインスタンスを初期化し、インストールするアセンブリと、新しい InstallContext オブジェクトを作成するときに使用するコマンド ラインの両方を指定します。 |
| AssemblyInstaller(String, String[]) |
AssemblyInstaller クラスの新しいインスタンスを初期化し、インストールするアセンブリのファイル名と、アセンブリのインストール用に新しい InstallContext オブジェクトを作成するときに使用するコマンド ラインの両方を指定します。 |
プロパティ
| Assembly |
インストールするアセンブリを取得または設定します。 |
| CanRaiseEvents |
コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。 (継承元 Component) |
| CommandLine |
アセンブリのインストール用に新しい InstallContext オブジェクトを作成するときに使用するコマンド ラインを取得または設定します。 |
| Container |
IContainer を含む Component を取得します。 (継承元 Component) |
| Context |
現在のインストールに関する情報を取得または設定します。 (継承元 Installer) |
| DesignMode |
Component が現在デザイン モードかどうかを示す値を取得します。 (継承元 Component) |
| Events |
Component に結び付けられているイベント ハンドラーのリストを取得します。 (継承元 Component) |
| HelpText |
インストーラー コレクション内のすべてのインストーラーに関するヘルプ テキストを取得します。 |
| Installers |
インストーラーが格納しているインストーラーのコレクションを取得します。 (継承元 Installer) |
| Parent |
インストーラーが属しているコレクションを格納しているインストーラーを取得または設定します。 (継承元 Installer) |
| Path |
インストールするアセンブリのパスを取得または設定します。 |
| Site |
Component の ISite を取得または設定します。 (継承元 Component) |
| UseNewContext |
アセンブリのインストール用に新しい InstallContext オブジェクトを作成するかどうかを示す値を取得または設定します。 |
メソッド
イベント
| AfterInstall |
Installers プロパティ内のすべてのインストーラーの Install(IDictionary) メソッドが実行された後で発生します。 (継承元 Installer) |
| AfterRollback |
Installers プロパティ内のすべてのインストーラーによるインストールがロールバックされた後で発生します。 (継承元 Installer) |
| AfterUninstall |
Installers プロパティ内のすべてのインストーラーのアンインストールが実行された後で発生します。 (継承元 Installer) |
| BeforeInstall |
インストーラー コレクション内の各インストーラーの Install(IDictionary) メソッドが実行される前に発生します。 (継承元 Installer) |
| BeforeRollback |
Installers プロパティ内のインストーラーがロールバックされる前に発生します。 (継承元 Installer) |
| BeforeUninstall |
Installers プロパティ内のインストーラーのアンインストールが実行される前に発生します。 (継承元 Installer) |
| Committed |
Installers プロパティ内のすべてのインストーラーがインストールをコミットした後で発生します。 (継承元 Installer) |
| Committing |
Installers プロパティ内のインストーラーがインストールをコミットする前に発生します。 (継承元 Installer) |
| Disposed |
Dispose() メソッドの呼び出しによってコンポーネントが破棄されるときに発生します。 (継承元 Component) |