次の方法で共有


プリンター ドライバーの INF ファイルで装飾を使用する方法

重要

Windows でプリンターとの通信手段として推奨されるのは、最新の印刷プラットフォームです。 プリンターデバイス開発におけるWindows 10および11での印刷体験をカスタマイズするために、MicrosoftのIPPインボックスクラスドライバーとPrint Support Apps (PSA)の使用を推奨します。

詳細については、最新の印刷プラットフォームに関する記事および「印刷サポート アプリの設計ガイド」を参照してください 。

WINDOWS Server 2003 SP1 以降、または 64 ビット バージョンの Windows XP 以降で実行され、x64 アーキテクチャを対象とするプリンター ドライバーには、次の例に示すように、装飾された INF モデル セクション が含まれている必要があります。 ただし、ドライバーは Windows Server 2003 SP1 より前のバージョンの Windows に追加のドライバーとしてインストールされる可能性があるため、INF ファイルには、未コーディングの INF モデル セクションも用意する必要があります。 Itanium ベースのドライバーをインストールするために装飾を使用することもお勧めします。

次の例では、1 つのプロセッサ アーキテクチャのドライバーをインストールするために使用できる INF ファイルを記述する方法を示します。

x64 ドライバー サンプル

最初の例では、Windows XP より前のバージョンの Windows、または Windows XP または Windows Server 2003 を実行している x86 または Itanium ベースのコンピューターに x64 ドライバーをインストールするために、非コーディングの INF モデル セクションを使用する方法を示します。 2 番目の INF モデル セクションの NTamd64 装飾により、WINDOWS Server 2003 SP1 以降を実行している任意のプロセッサ アーキテクチャのコンピューターに x64 ドライバーがインストールされます。

[MANUFACTURER]
%Acme Corp.% = Acme, NTamd64
...

[Acme]
"Acme LaserWhiz 100 PS" = Acme100_x64.PPD, <hardware IDs and compatible IDs for this printer>

[Acme.NTamd64]
"Acme LaserWhiz 100 PS" = Acme100_x64.PPD, <hardware IDs and compatible IDs for this printer>

Itanium ベースのドライバー サンプル

次の例では、非コーディングの INF モデル セクションを使用して、Windows XP より前のバージョンの Windows や、SP1 より前の Windows XP または Windows Server 2003 を実行している x86 マシンに、Itanium ベースのドライバーをインストールする方法を示します。 2 番目の INF モデル セクションの NTia64 装飾により、Windows Server 2003 SP1 以降を実行している任意のプロセッサ アーキテクチャのコンピューターに Itanium ベースのドライバーがインストールされます。

[MANUFACTURER]
%Acme Corp.% = Acme, NTia64
...

[Acme]
"Acme LaserWhiz 100 PS" = Acme100_ia64.PPD, <hardware IDs and compatible IDs for this printer>

[Acme.NTia64]
"Acme LaserWhiz 100 PS" = Acme100_ia64.PPD, <hardware IDs and compatible IDs for this printer>

x86 ドライバー サンプル

次の例では、INF モデル セクションには装飾は必要ありません。 非コーディングのセクションは x86 ドライバーを参照していると見なされるため、プロセッサ アーキテクチャを指定する必要はありません。 NTx86 装飾を使用して INF モデル セクションを追加することは許容されますが、Windows Server 2003 SP1 より前のバージョンの Windows には、未コーディングの INF モデル セクションも含める必要があることに注意してください。

[MANUFACTURER]
%Acme Corp.% = Acme
...

[Acme]
"Acme LaserWhiz 100 PS" = Acme100_x86.PPD, <hardware IDs and compatible IDs for this printer>

1 つの INF ファイルで複数のアーキテクチャをサポートする

このセクションでは、複数のプロセッサ アーキテクチャのプリンター ドライバーをインストールするために使用できる INF ファイルを記述する方法について説明します。

複数のアーキテクチャのドライバーをインストールするために使用できる INF ファイルを作成するには、INF モデル セクションを記述し、サポートされている各アーキテクチャに独自の INF モデル セクションが含まれるように、必要な数のコピーを作成します。 次の例に示すように、各プロセッサ アーキテクチャの適切な装飾を、結果として得られる各 INF モデル セクションに追加します。

[MANUFACTURER]
%Acme Corp% = Acme, NTamd64, NTia64
...

;; Used to install
;;    - a driver of any architecture type, on a machine running Windows 2000
;;    - a driver of any architecture type, on an x86 machine running Windows XP or Windows Server 2003
;;    - an x86 driver on a machine of any architecture type, running Windows Server 2003 with SP1
[Acme]
%Acme Model 1% = Acme100PS, <hardware IDs and compatible IDs for this printer>

;; Used to install
;;    - an x64 driver on a machine of any architecture type, running Windows Server 2003 with SP1
[Acme.NTamd64]
%Acme Model 1% = Acme100PS, <hardware IDs and compatible IDs for this printer>

;; Used to install
;;    - a driver of any architecture type, on an Itanium-based machine running Windows XP or Windows Server 2003
;;    - an Itanium-based driver on a machine of any architecture type, running Windows Server 2003 with SP1
[Acme.NTia64]
%Acme Model 1% = Acme100PS, <hardware IDs and compatible IDs for this printer>

;; DDInstall Section. 
;; This sample assumes that all three versions of the driver 
;; use the same DDInstall section.
[Acme100PS]
CopyFiles = MyDriverFile.dll, ...

[DestinationDirs]
DefaultDestDir=66000

[SourceDisksNames.x86]
1= %Location%,,,

[SourceDisksFiles.x86]
MyDriverFile.dll = 1,\i386
...

[SourceDisksNames.amd64]
1= %Location%,,,

[SourceDisksFiles.amd64]
MyDriverFile.dll = 1,\amd64
...

[SourceDisksNames.ia64]
1= %Location%,,,

[SourceDisksFiles.ia64]
MyDriverFile.dll = 1,\ia64
...

[Strings]
Acme Corp = "Acme Corporation"
Acme Model 1 = "Acme LaserWhiz 100 PS"
Location = "Acme CD ROM"