AssemblyInstaller.Commit(IDictionary) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
설치 트랜잭션을 완료합니다.
public:
override void Commit(System::Collections::IDictionary ^ savedState);
public override void Commit(System.Collections.IDictionary savedState);
override this.Commit : System.Collections.IDictionary -> unit
Public Overrides Sub Commit (savedState As IDictionary)
매개 변수
- savedState
- IDictionary
IDictionary 설치 관리자 컬렉션의 모든 설치 관리자가 실행된 후 컴퓨터의 상태를 포함하는 항목입니다.
예외
컬렉션에 Committing 있는 설치 관리자 중 하나의 이벤트 처리기에서 오류가 발생했습니다.
-또는-
컬렉션에 Committed 있는 설치 관리자 중 하나의 이벤트 처리기에서 오류가 발생했습니다.
-또는-
설치 단계에서 예외가 Commit(IDictionary) 발생했습니다. 예외가 무시되고 설치가 계속됩니다. 그러나 설치가 완료된 후 애플리케이션이 제대로 작동하지 않을 수 있습니다.
-또는-
어셈블리 중 하나에서 설치 관리자 형식을 찾을 수 없습니다.
-또는-
설치 관리자 유형 중 하나의 인스턴스를 만들 수 없습니다.
설치 단계에서 예외가 Commit(IDictionary) 발생했습니다. 예외가 무시되고 설치가 계속됩니다. 그러나 설치가 완료된 후 애플리케이션이 제대로 작동하지 않을 수 있습니다.
예제
다음 예제에서는 생성자 및 클래스의 AssemblyInstallerInstall 메서드를 보여 Commit 줍니다AssemblyInstaller.
AssemblyInstaller 생성자를 호출하여 클래스를 AssemblyInstaller 만듭니다. 이 개체의 속성이 설정되고 어셈블리를 Install 설치하기 위해 메서드와 Commit 메서드가 MyAssembly_Install.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;
void main()
{
IDictionary^ mySavedState = gcnew Hashtable;
Console::WriteLine( "" );
try
{
// Set the commandline argument array for 'logfile'.
array<String^>^myString = {"/logFile=example.log"};
// Create an Object* of the 'AssemblyInstaller' class.
AssemblyInstaller^ myAssemblyInstaller = gcnew AssemblyInstaller;
// Set the properties to install the required assembly.
myAssemblyInstaller->Path = "MyAssembly_Install.exe";
myAssemblyInstaller->CommandLine = myString;
myAssemblyInstaller->UseNewContext = true;
// Clear the 'IDictionary' Object*.
mySavedState->Clear();
// Install the 'MyAssembly_Install' assembly.
myAssemblyInstaller->Install( mySavedState );
// Commit the 'MyAssembly_Install' assembly.
myAssemblyInstaller->Commit( mySavedState );
}
catch ( Exception^ e )
{
Console::WriteLine( e );
}
}
using System;
using System.Configuration.Install;
using System.Collections;
using System.Collections.Specialized;
class MyInstallClass
{
static void Main()
{
IDictionary mySavedState = new Hashtable();
Console.WriteLine( "" );
try
{
// Set the commandline argument array for 'logfile'.
string[] myString = new string[ 1 ];
myString[ 0 ] = "/logFile=example.log";
// Create an object of the 'AssemblyInstaller' class.
AssemblyInstaller myAssemblyInstaller = new AssemblyInstaller();
// Set the properties to install the required assembly.
myAssemblyInstaller.Path = "MyAssembly_Install.exe";
myAssemblyInstaller.CommandLine = myString;
myAssemblyInstaller.UseNewContext = true;
// Clear the 'IDictionary' object.
mySavedState.Clear();
// Install the 'MyAssembly_Install' assembly.
myAssemblyInstaller.Install( mySavedState );
// Commit the 'MyAssembly_Install' assembly.
myAssemblyInstaller.Commit( mySavedState );
}
catch( Exception )
{
}
}
}
Imports System.Configuration.Install
Imports System.Collections
Imports System.Collections.Specialized
Class MyInstallClass
Shared Sub Main()
Dim mySavedState = New Hashtable()
Console.WriteLine("")
Try
' Set the commandline argument array for 'logfile'.
Dim myString(0) As String
myString(0) = "/logFile=example.log"
' Create an object of the 'AssemblyInstaller' class.
Dim myAssemblyInstaller As New AssemblyInstaller()
' Set the properties to install the required assembly.
myAssemblyInstaller.Path = "MyAssembly_Install.exe"
myAssemblyInstaller.CommandLine = myString
myAssemblyInstaller.UseNewContext = True
' Clear the 'IDictionary' object.
mySavedState.Clear()
' Install the 'MyAssembly_Install' assembly.
myAssemblyInstaller.Install(mySavedState)
' Commit the 'MyAssembly_Install' assembly.
myAssemblyInstaller.Commit(mySavedState)
Catch
End Try
End Sub
End Class
설명
이 메서드는 이 인스턴스 InstallerCollection 의 Install 모든 설치 관리자 메서드가 성공한 경우에만 호출됩니다. 그런 다음 이 메서드는 컬렉션에 Commit 있는 각 설치 관리자의 메서드를 호출합니다.
메서드에 전달되는 저장된 상태로 IDictionary올바른 제거 작업을 수행해야 할 Uninstall 수 있는 모든 정보를 저장합니다.