RunInstallerAttribute 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
어셈블리를 설치할 때 Visual Studio 사용자 지정 작업 설치 관리자 또는 Installutil.exe(설치 관리자 도구) 호출할지 여부를 지정합니다.
public ref class RunInstallerAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
public class RunInstallerAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type RunInstallerAttribute = class
inherit Attribute
Public Class RunInstallerAttribute
Inherits Attribute
- 상속
- 특성
예제
다음 예제에서는 설치 관리자를 실행 MyProjectInstaller해야 합니다.
[RunInstallerAttribute(true)]
ref class MyProjectInstaller: public Installer{
// Insert code here.
};
[RunInstallerAttribute(true)]
public class MyProjectInstaller : Installer {
// Insert code here.
}
<RunInstallerAttribute(True)> _
Public Class MyProjectInstaller
Inherits Installer
' Insert code here.
End Class
다음 예제에서는 .의 MyProjectInstaller인스턴스를 만듭니다. 그런 다음 클래스의 특성을 가져오고, 압축을 RunInstallerAttribute풀고, 설치 관리자를 실행할지 여부를 출력합니다.
int main()
{
// Creates a new installer.
MyProjectInstaller^ myNewProjectInstaller = gcnew MyProjectInstaller;
// Gets the attributes for the collection.
AttributeCollection^ attributes = TypeDescriptor::GetAttributes( myNewProjectInstaller );
/* Prints whether to run the installer by retrieving the
* RunInstallerAttribute from the AttributeCollection. */
RunInstallerAttribute^ myAttribute = dynamic_cast<RunInstallerAttribute^>(attributes[ RunInstallerAttribute::typeid ]);
Console::WriteLine( "Run the installer? {0}", myAttribute->RunInstaller );
return 0;
}
public static int Main() {
// Creates a new installer.
MyProjectInstaller myNewProjectInstaller = new MyProjectInstaller();
// Gets the attributes for the collection.
AttributeCollection attributes = TypeDescriptor.GetAttributes(myNewProjectInstaller);
/* Prints whether to run the installer by retrieving the
* RunInstallerAttribute from the AttributeCollection. */
RunInstallerAttribute myAttribute =
(RunInstallerAttribute)attributes[typeof(RunInstallerAttribute)];
Console.WriteLine("Run the installer? " + myAttribute.RunInstaller.ToString());
return 0;
}
Public Shared Function Main() As Integer
' Creates a new installer.
Dim myNewProjectInstaller As New MyProjectInstaller()
' Gets the attributes for the collection.
Dim attributes As AttributeCollection = TypeDescriptor.GetAttributes(myNewProjectInstaller)
' Prints whether to run the installer by retrieving the
' RunInstallerAttribute from the AttributeCollection.
Dim myAttribute As RunInstallerAttribute = _
CType(attributes(GetType(RunInstallerAttribute)), RunInstallerAttribute)
Console.WriteLine(("Run the installer? " & myAttribute.RunInstaller.ToString()))
Return 0
End Function 'Main
설명
Installer 상속된 클래스가 RunInstallerAttributetrue로 설정된 것으로 표시되면 어셈블리가 설치될 때 Visual Studio 사용자 지정 작업 설치 관리자 또는 InstallUtil.exe 호출됩니다. 집합 false 으로 RunInstallerAttribute 표시된 멤버는 설치 관리자를 호출하지 않습니다. 기본값은 true입니다.
메모
설정된 RunInstallerAttribute속성을 true 표시하면 이 특성의 값이 상수 멤버Yes로 설정됩니다. 집합RunInstallerAttribute으로 표시된 속성의 false 경우 값은 .입니다No. 따라서 코드에서 이 특성의 값을 확인하려면 특성을 다음과 같이 RunInstallerAttribute.YesRunInstallerAttribute.No지정해야 합니다.
자세한 내용은 특성을 참조하세요.
생성자
| Name | Description |
|---|---|
| RunInstallerAttribute(Boolean) |
RunInstallerAttribute 클래스의 새 인스턴스를 초기화합니다. |
필드
| Name | Description |
|---|---|
| Default |
기본 표시 유형(예 No: .)을 지정합니다. 이 |
| No |
어셈블리가 설치될 때 Visual Studio 사용자 지정 작업 설치 관리자 또는 Installutil.exe(설치 관리자 도구) 호출하지 않도록 지정합니다. 이 |
| Yes |
어셈블리가 설치될 때 Visual Studio 사용자 지정 작업 설치 관리자 또는 Installutil.exe(설치 관리자 도구) 호출되도록 지정합니다. 이 |
속성
| Name | Description |
|---|---|
| RunInstaller |
어셈블리를 설치하는 동안 설치 관리자를 호출해야 하는지 여부를 나타내는 값을 가져옵니다. |
| TypeId |
파생 클래스에서 구현되는 경우 이 Attribute대한 고유 식별자를 가져옵니다. (다음에서 상속됨 Attribute) |
메서드
| Name | Description |
|---|---|
| Equals(Object) |
지정된 RunInstallerAttribute 값이 현재 RunInstallerAttribute값과 같은지 여부를 확인합니다. |
| GetHashCode() |
현재 RunInstallerAttribute에 대한 해시 코드를 생성합니다. |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| IsDefaultAttribute() |
이 특성이 기본값인지 여부를 확인합니다. |
| Match(Object) |
파생 클래스에서 재정의되는 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다. (다음에서 상속됨 Attribute) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
명시적 인터페이스 구현
| Name | Description |
|---|---|
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
이름 집합을 해당 디스패치 식별자 집합에 매핑합니다. (다음에서 상속됨 Attribute) |
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
인터페이스의 형식 정보를 가져오는 데 사용할 수 있는 개체의 형식 정보를 검색합니다. (다음에서 상속됨 Attribute) |
| _Attribute.GetTypeInfoCount(UInt32) |
개체가 제공하는 형식 정보 인터페이스의 수를 검색합니다(0 또는 1). (다음에서 상속됨 Attribute) |
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
개체에 의해 노출되는 속성 및 메서드에 대한 액세스를 제공합니다. (다음에서 상속됨 Attribute) |