無人セットアップを使用した IIS 7.0 のインストール
作成者 :Tobin Titus
発行日 : 2007 年 11 月 22 日 (作業者 : saad)
更新日 : 2008 年 3 月 12 日 (作業者 : saad)
はじめに
Pkgmgr.exe は、Windows のオプション機能をインストールする際に使用する Windows Vista/Windows ServerR 2008 の新しいコマンド ツールです。
- Windows のオプション機能をインストールする際に sysocmgr.exe の代わりに使用します。
- コマンド プロンプトまたはスクリプトから直接、Windows Vista のオプション機能をインストール/アンインストールできます。
Pkgmgr では、コマンド ラインでインストールする Windows 機能の一覧を指定することも、無人インストールのパラメーターとして xml ファイル名を指定することもできます。この記事では、オプション機能をインストールする際に pkgmgr の無人セットアップ ファイルを使用する方法を説明します。
前提条件
Windows Vista/Windows Server 2008 のサポートされているエディション
このチュートリアルは、Windows Vista/Windows Server 2008 の次のエディションを対象としています。
- Windows Vista Home Premium Edition
- Windows Vista Professional Edition
- Windows Vista Ultimate Edition
- Windows Server 2008 の各エディション
Windows Vista/Windows Server 2008 のサポートされているエディションのいずれかをインストールしていることを確認してから、作業を進めてください。
ローカル ユーザー管理者 (LUA) のセキュリティ
コンピューターの管理者特権があることを確認してください。既定では、ビルトイン Administrator アカウント以外のユーザーとしてログオンした場合、そのユーザーがコンピューターのローカルの Administrators グループに追加されていても、管理者特権はありません (これは、Windows Server 2008 の新しいセキュリティ機能で、LUA と呼ばれます。ただし、この記事では説明しません)。必ず、ビルトイン Administrator アカウントでログオンするか、必要に応じて "runas" コマンド ライン ツールを使用して、ビルトイン Administrator として明示的にアプリケーションを起動してください。
たとえば、notepad.exe を起動するには、"runas /user:administrator notepad.exe" というコマンドを実行します。Administrator アカウントのパスワードが要求されます。"runas /user:administrator cmd.exe" を実行して、既に管理者特権を持っているコマンド ボックス シェルを使用すると便利です。そのコマンド ボックスから実行する各アプリケーションでも管理者特権が与えられるので、そのコマンド ボックスで "runas" 構文を使用する必要がなくなります。
手順
手順 1 : Pkgmgr.exe の概要
Vista/Windows Server 2008 の Windows のオプション機能をインストールするには、Pkgmgr という新しいコマンド ツールを使用します。pkgmgr.exe を使用したコマンド ライン構文は次のとおりです。
Start /w pkgmgr.exe /iu:update1;update2…
Pkgmgr.exe のコマンド
/iu:{update name};
ここでは、インストールする更新プログラムを更新プログラム名で指定して、インストールする更新プログラムの名前をセミコロンで区切ります。
/uu:{update name};
ここでは、アンインストールする更新プログラム指定して、システムからアンインストールする選択可能な更新プログラムの一覧をセミコロンで区切ります。更新プログラム名を少なくとも 1 つ指定する必要があります。
/n:{unattend XML}
ここでは、無人セットアップ用の XML ファイルのファイル名を指定します。
注 : "start /w" プレフィックスを付けないで pkgmgr を実行した場合、pkgmgr コマンドが直ちに返され、オプション機能のインストールがいつ完了したかがわからなくなります。
手順 2 : コマンド ウィンドウを開く
前述の「前提条件」のセクションに記載されている指示に従って、ローカル管理者アカウントでコマンド ウィンドウの実行を開始します。
手順 3 : Unattend.xml ファイルを作成する
コマンド ウィンドウで notepad.exe を実行します。
IIS 7.0 の既定の機能のみをインストールする場合は、次の unattend.xml テキストをコピーしてメモ帳に貼り付けます。
<?xml version="1.0" ?>
<unattend xmlns="urn:schemas-microsoft-com:unattend"
xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State">
<servicing>
<!-- Install a selectable update in a package that is in the Windows Foundation namespace -->
<package action="configure">
<ssemblyIdentity
name="Microsoft-Windows-Foundation-Package"
version="6.0.5308.6"
language="neutral"
processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
versionScope="nonSxS"
/>
<selection name="IIS-WebServerRole" state="true"/>
<selection name="WAS-WindowsActivationService" state="true"/>
<selection name="WAS-ProcessModel" state="true"/>
<selection name="WAS-NetFxEnvironment" state="true"/>
<selection name="WAS-ConfigurationAPI" state="true"/>
</package>
</servicing>
</unattend>
</pre>
評価用に IIS 7.0 のすべての機能をインストールする場合は、次の unattend.xml ファイルのいずれかを使用します。
Windows Vista Professional、Windows Vista Ultimate、または Windows Server 2008 の各エディションには、次のテキストをコピーしてメモ帳に貼り付けます。
<?xml version="1.0" ?>
<unattend xmlns="urn:schemas-microsoft-com:unattend"
xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State">
<servicing>
<!-- Install a selectable update in a package that is in the Windows Foundation namespace -->
<package action="configure">
<assemblyIdentity
name="Microsoft-Windows-Foundation-Package"
version="6.0.5308.6"
language="neutral"
processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
versionScope="nonSxS"
/>
<selection name="IIS-WebServerRole" state="true"/>
<selection name="IIS-WebServer" state="true"/>
<selection name="IIS-CommonHttpFeatures" state="true"/>
<selection name="IIS-StaticContent" state="true"/>
<selection name="IIS-DefaultDocument" state="true"/>
<selection name="IIS-DirectoryBrowsing" state="true"/>
<selection name="IIS-HttpErrors" state="true"/>
<selection name="IIS-HttpRedirect" state="true"/>
<selection name="IIS-ApplicationDevelopment" state="true"/>
<selection name="IIS-ASPNET" state="true"/>
<selection name="IIS-NetFxExtensibility" state="true"/>
<selection name="IIS-ASP" state="true"/>
<selection name="IIS-CGI" state="true"/>
<selection name="IIS-ISAPIExtensions" state="true"/>
<selection name="IIS-ISAPIFilter" state="true"/>
<selection name="IIS-ServerSideIncludes" state="true"/>
<selection name="IIS-HealthAndDiagnostics" state="true"/>
<selection name="IIS-HttpLogging" state="true"/>
<selection name="IIS-LoggingLibraries" state="true"/>
<selection name="IIS-RequestMonitor" state="true"/>
<selection name="IIS-HttpTracing" state="true"/>
<selection name="IIS-CustomLogging" state="true"/>
<selection name="IIS-ODBCLogging" state="true"/>
<selection name="IIS-Security" state="true"/>
<selection name="IIS-BasicAuthentication" state="true"/>
<selection name="IIS-WindowsAuthentication" state="true"/>
<selection name="IIS-DigestAuthentication" state="true"/>
<selection name="IIS-ClientCertificateMappingAuthentication" state="true"/>
<selection name="IIS-IISCertificateMappingAuthentication" state="true"/>
<selection name="IIS-URLAuthorization" state="true"/>
<selection name="IIS-RequestFiltering" state="true"/>
<selection name="IIS-IPSecurity" state="true"/>
<selection name="IIS-Performance" state="true"/>
<selection name="IIS-HttpCompressionStatic" state="true"/>
<selection name="IIS-HttpCompressionDynamic" state="true"/>
<selection name="IIS-WebServerManagementTools" state="true"/>
<selection name="IIS-ManagementConsole" state="true"/>
<selection name="IIS-ManagementScriptingTools" state="true"/>
<selection name="IIS-ManagementService" state="true"/>
<selection name="IIS-IIS6ManagementCompatibility" state="true"/>
<selection name="IIS-Metabase" state="true"/>
<selection name="IIS-WMICompatibility" state="true"/>
<selection name="IIS-LegacyScripts" state="true"/>
<selection name="IIS-LegacySnapIn" state="true"/>
<selection name="IIS-FTPPublishingService" state="true"/>
<selection name="IIS-FTPServer" state="true"/>
<selection name="IIS-FTPManagement" state="true"/>
<selection name="WAS-WindowsActivationService" state="true"/>
<selection name="WAS-ProcessModel" state="true"/>
<selection name="WAS-NetFxEnvironment" state="true"/>
<selection name="WAS-ConfigurationAPI" state="true"/>
</package>
</servicing>
</unattend>
Windows Vista Home Premium に IIS 7.0 をインストールする場合は、次のテキストをコピーしてメモ帳に貼り付けます。
<?xml version="1.0" ?>
<unattend xmlns="urn:schemas-microsoft-com:unattend"
xmlns:wcm="https://schemas.microsoft.com/WMIConfig/2002/State">
<servicing>
<!-- Install a selectable update in a package that is in the Windows Foundation namespace -->
<package action="configure">
<assemblyIdentity
name="Microsoft-Windows-Foundation-Package"
version="6.0.5303.0"
language="neutral"
processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35"
versionScope="nonSxS"
/>
<selection name="IIS-WebServerRole" state="true"/>
<selection name="IIS-WebServer" state="true"/>
<selection name="IIS-CommonHttpFeatures" state="true"/>
<selection name="IIS-StaticContent" state="true"/>
<selection name="IIS-DefaultDocument" state="true"/>
<selection name="IIS-DirectoryBrowsing" state="true"/>
<selection name="IIS-HttpErrors" state="true"/>
<selection name="IIS-HttpRedirect" state="true"/>
<selection name="IIS-ApplicationDevelopment" state="true"/>
<selection name="IIS-ASPNET" state="true"/>
<selection name="IIS-NetFxExtensibility" state="true"/>
<selection name="IIS-ASP" state="true"/>
<selection name="IIS-CGI" state="true"/>
<selection name="IIS-ISAPIExtensions" state="true"/>
<selection name="IIS-ISAPIFilter" state="true"/>
<selection name="IIS-ServerSideIncludes" state="true"/>
<selection name="IIS-HealthAndDiagnostics" state="true"/>
<selection name="IIS-HttpLogging" state="true"/>
<selection name="IIS-LoggingLibraries" state="true"/>
<selection name="IIS-RequestMonitor" state="true"/>
<selection name="IIS-HttpTracing" state="true"/>
<selection name="IIS-CustomLogging" state="true"/>
<selection name="IIS-ODBCLogging" state="true"/>
<selection name="IIS-Security" state="true"/>
<selection name="IIS-BasicAuthentication" state="true"/>
<selection name="IIS-URLAuthorization" state="true"/>
<selection name="IIS-RequestFiltering" state="true"/>
<selection name="IIS-IPSecurity" state="true"/>
<selection name="IIS-Performance" state="true"/>
<selection name="IIS-HttpCompressionStatic" state="true"/>
<selection name="IIS-HttpCompressionDynamic" state="true"/>
<selection name="IIS-WebServerManagementTools" state="true"/>
<selection name="IIS-ManagementConsole" state="true"/>
<selection name="IIS-ManagementScriptingTools" state="true"/>
<selection name="IIS-ManagementService" state="true"/>
<selection name="IIS-IIS6ManagementCompatibility" state="true"/>
<selection name="IIS-Metabase" state="true"/>
<selection name="IIS-WMICompatibility" state="true"/>
<selection name="IIS-LegacyScripts" state="true"/>
<selection name="IIS-LegacySnapIn" state="true"/>
<selection name="WAS-WindowsActivationService" state="true"/>
<selection name="WAS-ProcessModel" state="true"/>
<selection name="WAS-NetFxEnvironment" state="true"/>
<selection name="WAS-ConfigurationAPI" state="true"/>
</package>
</servicing>
</unattend>
</pre>
手順 4 : Windows ビルド番号を取得する
インストールした Windows のバージョン番号をチェックする必要があります。正確なバージョンを確認するには、次の手順を実行します。
1. [スタート] メニューで [ファイル名を指定して実行]をクリックして、エクスプローラーに移動します。
エクスプローラーで Windows ディレクトリを参照して、regedit.exe を検索します。
regedit.exe を右クリックして [プロパティ] を選択します。
[プロパティ] ダイアログ ボックスで [詳細] タブをクリックし、[製品バージョン] を確認します。
2. メモ帳で、この値を XML 属性バージョンに入力して、インストールしたビルドと一致させます。
この場合、バージョンは "6.0.5308.6" です。
64 ビット CPU にインストールした場合は、processorArchitecture XML 属性を編集する必要があります。
processorArchitecture="amd64"
注 : 選択できる値は、x86、amd64、および ia64 です。
手順 5 : Unattend.xml ファイルを保存する
メモ帳のファイルを "unattend.xml" という名前で保存します。
手順 6 : Unattend.xml ファイルで Pkgmgr を実行する
コマンド ウィンドウで、次のコマンド ラインを入力します。
start /w pkgmgr /n:unattend.xml
注 : unattend.xml を現在のドライブおよびコマンド ウィンドウのフォルダー以外のドライブのフォルダーに保存した場合、pkgmgr /n: parameter に unattend.xml ファイルの完全なパスを指定する必要があります。
手順 7 : セットアップの完了まで待つ
pkgmgr.exe を使用した IIS 7.0 のセットアップには、1 ~ 5 分かかります。コマンド プロンプトが返されたら、IIS 7.0 のセットアップは完了です。
手順 8 : エラー コードをチェックする
コマンド プロンプトで、次のように入力します。
echo %errorlevel%
結果が 0 であれば、インストールに成功したことを示します。
まとめ
この記事では、pckmgr.exe を使用してオペレーティング システムと IIS 7.0 をインストールする方法を説明しました。