InstallContext コンストラクタ ()
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)
構文
解説
使用例
メモ |
---|
InstallContext コンストラクタのオーバーロードされたバージョンのいずれかの使用方法を次の例に示します。その他の例については、個々のオーバーロードのトピックを参照してください。 |
引数なしでプログラムを起動すると、空の InstallContext が作成されます。
' There are no command line arguments, create an empty 'InstallContext'. myInstallObject.myInstallContext = New InstallContext()
// There are no command line arguments, create an empty 'InstallContext'. myInstallObject.myInstallContext = new InstallContext();
// There are no command line arguments, create an empty 'InstallContext'.
myInstallObject->myInstallContext = gcnew InstallContext;
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
InstallContext コンストラクタ (String, String[])
アセンブリ: System.Configuration.Install (system.configuration.install.dll 内)
構文
Dim logFilePath As String Dim commandLine As String() Dim instance As New InstallContext(logFilePath, commandLine)
public InstallContext ( string logFilePath, string[] commandLine )
public InstallContext ( String logFilePath, String[] commandLine )
- commandLine
セットアップ プログラムの実行時に入力されたコマンド ライン パラメータ。入力されなかった場合は null 参照 (Visual Basic では Nothing)。
インストールに インストーラ ツール (Installutil.exe) を使用する場合、このコンストラクタは指定したパスにログ ファイルを作成し、コマンド ライン パラメータの配列を解析した結果を Parameters プロパティに格納します。コマンド ライン パラメータでログ ファイルのパスが指定されている場合は、このパスを使用してファイルが作成されます。コマンド ラインでログ ファイルの引数が指定されていない場合は、logFilePath パラメータの値が使用されます。ログ ファイルを作成しない場合は、"/logfile=" コマンド ライン パラメータを渡します。
呼び出し時の注意 このコンストラクタを呼び出すときは、logFilePath パラメータに既定のログ ファイル パスを渡します。インストール実行可能ファイルの実行時に /logfile コマンド ライン パラメータが使用される場合を除いて、指定した場所にログ ファイルが作成されます。この例は、InstallContext クラスの概要で紹介されているクラスの例からの抜粋です。
"/LogFile" および "/LogtoConsole" を指定した場合、それぞれの引数を InstallContext に渡して、InstallContext が作成されます。
' Create an InstallContext object with the given parameters. Dim commandLine() As String = New String(args.Length - 2) {} Dim i As Integer For i = 1 To args.Length - 1 commandLine(i-1) = args(i) Next i myInstallObject.myInstallContext = _ New InstallContext("/LogFile:example.log", commandLine)
// Create an InstallContext object with the given parameters. String[] commandLine = new string[ args.Length ]; for( int i = 0; i < args.Length; i++ ) { commandLine[ i ] = args[ i ]; } myInstallObject.myInstallContext = new InstallContext( args[ 0 ], commandLine);
// Create an InstallContext object with the given parameters. array<String^>^commandLine = gcnew array<String^>(args->Length - 1); for ( int i = 0; i < args->Length - 1; i++ ) { commandLine[ i ] = args[ i + 1 ]; } myInstallObject->myInstallContext = gcnew InstallContext( args[ 1 ],commandLine );
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
InstallContext コンストラクタ
- InstallContext コンストラクタ ()のページへのリンク