Inf2Cat

Inf2Cat (Inf2Cat.exe) 是命令列工具,可判斷 驅動程式套件的 INF 檔案是否可以針對指定的 Windows 版本清單進行數位簽署。 如果是,Inf2Cat 會產生套用至指定 Windows 版本的未簽署 目錄檔案

    Inf2Cat /driver:
    PackagePath
     /os:
    WindowsVersionList [/nocat] [/verbose] [/?] [other switches]

Inf2Cat 工具位於 WDK 的 Program Files\Windows Kits\8.0\bin\x86 或 Program Files (x86) \Windows Kits\8.0\bin\x86 資料夾中。

疑難排解

如果您在建置驅動程式時看到 DriverVer set to a date in the future ,請變更驅動程式套件專案設定,讓 Inf2Cat 設定 /uselocaltime 。 若要這樣做,請使用 Configuration Properties-Inf2Cat-General-Use >>> 當地時間。 現在 Stampinf 和 Inf2Cat 都使用當地時間。

如果您看到 An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) Signability test failed. ,請嘗試下列其中一個因應措施:

  1. 將專案的 inf2cat 設定設為 /nocat ,並手動執行 inf2cat。
  2. \x86 使用中 WDK 的 資料夾中刪除 inf2cat.exe.manifest ,使工具在 Visual Studio 中執行。

參數和引數

/driver:PackagePath

指定包含驅動程式套件 INF 檔案之目錄的路徑。 如果指定的目錄包含多個驅動程式套件的 INF 檔案,Inf2Cat 會為每個驅動程式套件建立類別目錄檔案。

注意

您可以使用 /drv: 參數取代 /driver: switch。

/nocat

設定 Inf2Cat 以確認 驅動程式套件 符合指定 Windows 版本的簽署需求,但無法產生類別目錄檔案。

/os:WindowsVersionList

設定 Inf2Cat 以確認 驅動程式套件的 INF 檔案符合 WindowsVersionList所指定 Windows 版本的簽署需求。 WindowsVersionList 是以逗號分隔的清單,其中包含下列一或多個版本識別碼。

Windows 版本 版本識別碼
Windows 11版本 22H2 x64 Edition 10_NI_X64
Windows 11版本 22H2 Arm64 Edition 10_NI_ARM64
Windows 11版本 21H2 x64 Edition 10_CO_X64
Windows 11版本 21H2 Arm64 Edition 10_CO_ARM64
Windows Server 2022 x64 版本 ServerFE_X64
Windows Server 2022 Arm64 版本 ServerFE_ARM64
Windows 10版本 22H2、21H2、21H1、20H2、2004 x86 Edition 10_VB_X86
Windows 10版本 22H2、21H2、21H1、20H2、2004 x64 Edition 10_VB_X64
Windows 10版本 22H2、21H2、21H1、20H2、2004 Arm64 版本 10_VB_ARM64
Windows 10版本 1909、1903 x86 Edition 10_19H1_X86
Windows 10版本 1909、1903 x64 Edition 10_19H1_X64
Windows 10版本 1909、1903 Arm64 Edition 10_19H1_ARM64
Windows 10 版本 1809 x86 Edition 10_RS5_X86
Windows 10 版本 1809 x64 版本 10_RS5_X64
Windows 10 版本 1809 Arm64 版本 10_RS5_ARM64
Windows Server 2019 x64 版本 ServerRS5_X64
Windows Server 2019 Arm64 版本 ServerRS5_ARM64
Windows 10 1803 x86 版 10_RS4_X86
Windows 10版本 1803 x64 Edition 10_RS4_X64
Windows 10版本 1803 Arm64 Edition 10_RS4_ARM64
Windows 10 1709 x86 版 10_RS3_X86
Windows 10版本 1709 x64 Edition 10_RS3_X64
Windows 10版本 1709 Arm64 版本 10_RS3_ARM64
Windows 10 1703 x86 版 10_RS2_X86
Windows 10 1703 x64 版 10_RS2_X64
Windows 10版本 1607 x86 Edition 10_AU_X86
Windows 10 1607 x64 版 10_AU_X64
Windows Server 2016 x64 Edition SERVER2016_X64
Windows 10 x86 版本 10_X86
Windows 10 x64 版本 10_X64
Windows Server 2016 Server10_X64
arm 上的Windows Server 2016 Server10_ARM64

注意

從 Windows Server 2008 R2 開始,Windows Server 作業系統將不再支援以 x86 為基礎的平臺。

Inf2Cat 會忽略版本識別碼字串的字母字元大小寫。 例如,10_NI_X64和10_ni_X64都是 Windows 11 22H2 x64 版的有效識別碼。

/uselocaltime

在執行驅動程式時間戳記驗證測試時,請使用當地時區。 預設會使用 UTC。

/verbose

設定 Inf2Cat 在命令視窗中顯示詳細資訊。

/?

設定 Inf2Cat 在命令視窗中顯示說明資訊。

/Drm

已被取代的命令列引數。
在 .inf 檔案中新增 drm 簽章屬性,以新增 drm 簽章屬性。

/體育

已被取代的命令列引數。
在 .inf 檔案中新增 petrust 簽章屬性,以新增 petrust 簽章屬性。

/pageHashes

包含含有檔案的頁面雜湊。 選擇性地接著檔案清單。

註解

Inf2Cat 工具會檢查 驅動程式套件的 INF 檔案是否有結構化錯誤,並確認驅動程式套件可以數位簽署。 只有在 INF 檔案中參考的所有檔案都存在且原始程式檔位於正確的位置時,才能簽署驅動程式套件。 如果無法簽署 INF 檔案或包含結構化錯誤,驅動程式套件可能無法正確安裝,或可能會在安裝期間不正確地顯示驅動程式簽署警告對話方塊。

只有在驅動程式套件的 INF 檔案中指定 類別目錄 檔案,且類別目錄檔案套用至一或多個指定的 Windows 版本時,Inf2Cat 才會產生類別目錄檔案。 如果 INF 檔案的 INF 版本區段 只提供 CatalogFile=filename.cat 指示詞,該類別目錄檔案會套用至整個驅動程式套件。 若要支援跨平臺安裝,INF 檔案應該包含 CatalogFile。PlatformExtension=unique-filename.cat指示詞。

如需簽署驅動程式套件的詳細資訊,請參閱 驅動程式簽署

若要使用 Inf2Cat,您必須是系統上 Administrators 群組的成員。

範例

在下列範例中,c:\MyDriver 包含 驅動程式套件 ,其 INF 檔案是 MyInfFile.inf,而 INF 檔案中的 INF 版本區段只包含下列 CatalogFile 指示詞:

[Version]
. . .
CatalogFile=MyCatalogFile.cat
. . .

在此範例中,下列 Inf2Cat 命令會驗證驅動程式套件是否可以簽署Windows 10版本 21H2、21H1、20H2、20H2、2004 x64 Edition 和 Windows 11 版本 21H2 x64 Edition。 如果可以簽署這些版本的套件,Inf2Cat 會建立未簽署的類別目錄檔案 MyCatalogFile.cat。

Inf2Cat /driver:C:\MyDriver /os:10_VB_X64,10_CO_X64 

在下列範例中,c:\MyDriver 包含 驅動程式套件 ,其 INF 檔案是 MyInfFile.inf,而 INF 檔案中的 INF 版本 區段只包含下列兩個 CatalogFile 指示詞,其中包含平臺延伸模組:

[Version]
. . .
CatalogFile.ntx86=MyCatalogFileX86.cat
CatalogFile.ntamd64=MyCatalogFileX64.cat
. . .

在此範例中,下列 Inf2Cat 命令會驗證驅動程式套件是否可以簽署 Windows 10 版本 1809 x86 Edition 和 X64 Edition。 此外,它會檢查 Windows Windows 10版本 1909、1903 x86 版本和 X64 版本是否可以簽署。 如果封裝可以簽署所有這些版本,Inf2Cat 會建立未簽署的類別目錄檔案 MyCatalogFileX86.cat 和 MyCatalogFileX64.cat。

Inf2Cat /driver:C:\MyDriver /os:10_RS5_X86,10_RS5_X64,10_19H1_X86,10_19H1_X64 

如需如何使用 Inf2Cat 建立類別目錄檔案的詳細資訊,請參閱 建立 PnP 驅動程式套件的類別目錄檔案