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が作成されます。 このオブジェクトのプロパティが設定され、MyAssembly.exe アセンブリをインストールするためにInstallメソッドとCommit メソッドが呼び出されます。
#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) |
| UseNewContext |
アセンブリのインストール用に新しい InstallContext オブジェクトを作成するかどうかを示す値を取得または設定します。 |
メソッド
イベント
| 名前 | 説明 |
|---|---|
| AfterInstall |
Install(IDictionary) プロパティ内のすべてのインストーラーのInstallers メソッドが実行された後に発生します。 (継承元 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) |