RunInstallerAttribute 클래스

정의

어셈블리가 설치될 때 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
상속
RunInstallerAttribute
특성

예제

다음 예제에서는 에 대해 설치 관리자를 실행해야 한다고 지정합니다 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

다음 예제에서는 의 instance 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. 로 설정된 false로 표시된 속성의 RunInstallerAttribute 경우 값은 입니다No. 따라서 코드에서이 특성의 값을 확인 하려는 경우 특성으로 지정 해야 합니다 RunInstallerAttribute.Yes 또는 RunInstallerAttribute.No합니다.

자세한 내용은 특성을 참조하세요.

생성자

RunInstallerAttribute(Boolean)

RunInstallerAttribute 클래스의 새 인스턴스를 초기화합니다.

필드

Default

기본 표시 유형인 No를 지정합니다. 이 static 필드는 읽기 전용입니다.

No

어셈블리가 설치될 때 Visual Studio 사용자 지정 동작 설치 관리자 또는 Installutil.exe(설치 관리자 도구)의 호출 여부를 지정합니다. 이 static 필드는 읽기 전용입니다.

Yes

어셈블리가 설치될 때 Visual Studio 사용자 지정 동작 설치 관리자 또는 Installutil.exe(설치 관리자 도구)의 호출 여부를 지정합니다. 이 static 필드는 읽기 전용입니다.

속성

RunInstaller

어셈블리를 설치할 때 설치 관리자를 호출해야 할지 여부를 나타내는 값을 가져옵니다.

TypeId

파생 클래스에서 구현된 경우 이 Attribute에 대한 고유 식별자를 가져옵니다.

(다음에서 상속됨 Attribute)

메서드

Equals(Object)

지정된 RunInstallerAttribute의 값이 현재 RunInstallerAttribute와 같은지 여부를 확인합니다.

GetHashCode()

현재 RunInstallerAttribute의 해시 코드를 생성합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
IsDefaultAttribute()

이 특성이 기본값인지 여부를 확인합니다.

Match(Object)

파생 클래스에서 재정의된 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Attribute)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

_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)

적용 대상

추가 정보