RunInstallerAttributeとは? わかりやすく解説

RunInstallerAttribute クラス

アセンブリインストール時に、Visual StudioCustom Action Installer または インストーラ ツール (Installutil.exe) が起動されかどうか指定します

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

<AttributeUsageAttribute(AttributeTargets.Class)> _
Public Class RunInstallerAttribute
    Inherits Attribute
Dim instance As RunInstallerAttribute
[AttributeUsageAttribute(AttributeTargets.Class)] 
public class RunInstallerAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class)] 
public ref class RunInstallerAttribute : public
 Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class) */ 
public class RunInstallerAttribute extends
 Attribute
AttributeUsageAttribute(AttributeTargets.Class) 
public class RunInstallerAttribute extends
 Attribute
解説解説

Installer から継承するクラスが、RunInstallerAttributetrue設定してマークされている場合は、アセンブリインストール時に、Visual StudioCustom Action Installer または InstallUtil.exe が起動されます。RunInstallerAttributefalse設定してマークされメンバは、インストーラ起動しません。既定値false です。

メモメモ

trueRunInstallerAttribute使用してプロパティマークすると、この属性の値は定数メンバ Yes に設定されます。RunInstallerAttributefalse設定してマークされプロパティ場合、値は No になります。したがってコード内でこの属性の値を確認する場合は、属性RunInstallerAttribute.Yes または RunInstallerAttribute.No として指定する必要があります

詳細については、属性概要属性使用したメタデータ拡張 の各トピック参照してください

使用例使用例

MyProjectInstaller に対してインストーラ実行する必要があることを指定する例を次に示します

<RunInstallerAttribute(True)> _
Public Class MyProjectInstaller
    Inherits Installer

    ' Insert code here.
End Class 'MyProjectInstaller
[RunInstallerAttribute(true)]
 public class MyProjectInstaller : Installer
 {
    // Insert code here.
 }
[RunInstallerAttribute(true)]
ref class MyProjectInstaller: public Installer{
   // Insert code here.
};
/** @attribute RunInstallerAttribute(true)
 */
public static class MyProjectInstaller
 extends Installer
{
    // Insert code here.
} //MyProjectInstaller

MyProjectInstallerインスタンス作成する例を次に示します。そのクラス属性取得しRunInstallerAttribute抽出してから、インストーラ実行するかどうか出力します

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
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;
 }
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 void main(String[]
 args)
{
    // 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.get_Item(
        RunInstallerAttribute.class.ToType())));

    Console.WriteLine(("Run the installer? " 
        + System.Convert.ToString(myAttribute.get_RunInstaller())));
} //main
継承階層継承階層
System.Object
   System.Attribute
    System.ComponentModel.RunInstallerAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

RunInstallerAttribute コンストラクタ


RunInstallerAttribute フィールド


RunInstallerAttribute プロパティ


RunInstallerAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます指定した RunInstallerAttributeの値が、現在の RunInstallerAttribute等しかどうか判断します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされます現在の RunInstallerAttributeハッシュ コード生成します
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute オーバーライドされます。 この属性既定値かどうか判断します
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

RunInstallerAttribute クラス
System.ComponentModel 名前空間
Attribute
Installer

RunInstallerAttribute メンバ

アセンブリインストール時に、Visual StudioCustom Action Installer または インストーラ ツール (Installutil.exe) が起動されかどうか指定します

RunInstallerAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド RunInstallerAttribute RunInstallerAttribute クラス新しインスタンス初期化します。
パブリック フィールドパブリック フィールド
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます指定した RunInstallerAttributeの値が、現在の RunInstallerAttribute等しかどうか判断します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされます現在の RunInstallerAttributeハッシュ コード生成します
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute オーバーライドされます。 この属性既定値かどうか判断します
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

RunInstallerAttribute クラス
System.ComponentModel 名前空間
Attribute
Installer


このページでは「.NET Framework クラス ライブラリ リファレンス」からRunInstallerAttributeを検索した結果を表示しています。
Weblioに収録されているすべての辞書からRunInstallerAttributeを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からRunInstallerAttribute を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「RunInstallerAttribute」の関連用語

RunInstallerAttributeのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



RunInstallerAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS