共用方式為


INF ControlFlags 區段

ControlFlags 區段會識別 Windows 在安裝期間應採取特定唯一動作的裝置。

[ControlFlags]

ExcludeFromSelect=* | 
ExcludeFromSelect=device-identification-string[,device-identification-string] ...] | 
[ExcludeFromSelect.nt=device-identification-string[,device-identification-string] ...] | 
[ExcludeFromSelect.ntx86=device-identification-string[,device-identification-string] ...] | 
[ExcludeFromSelect.ntia64=device-identification-string[,device-identification-string] ...]  |  (Windows XP and later versions of Windows)
[ExcludeFromSelect.ntamd64=device-identification-string[,device-identification-string] ...]  |  (Windows XP and later versions of Windows)
[ExcludeFromSelect.ntarm=device-identification-string[,device-identification-string] ...]  |  (Windows 8 and later versions of Windows)
[ExcludeFromSelect.ntarm64=device-identification-string[,device-identification-string] ...]  |  (Windows 10 version 1709 and later versions of Windows)

[CopyFilesOnly=device-identification-string[,device-identification-string] ...]
[InteractiveInstall=device-identification-string[,device-identification-string] ... ]
[RequestAdditionalSoftware=*] | 
[RequestAdditionalSoftware=device-identification-string[,device-identification-string] ...]  (Windows 7 through Windows 10 version 1709)

項目

device-identification-string
識別每一製造商 INF 型號一節中指定的硬體識別碼或相容標識碼。 每個字串都必須以逗號分隔 (,) 。

ExcludeFromSelect
如果指定 *) 或特定使用者介面顯示的指定裝置清單,則會移除所有 (,使用者預期要從中選取特定裝置進行安裝。

針對 Windows 2000 和更新版本的 Windows,指定的裝置會顯示在 [找到的新硬體精靈] 和 [硬體更新精靈] 中。

若要從此顯示中排除一組OS不相容或平臺不相容的裝置,一或多個 ExcludeFromSelect 專案可以附加下列不區分大小寫的擴充功能:

。Nt
請勿在執行 Windows 2000 或更新版本的 Windows 電腦上顯示這些裝置。

.ntx86
請勿在執行 Windows 2000 或更新版本的 Windows 的 x86 計算機上顯示這些裝置。

.ntia64
請勿在執行 Windows XP 或更新版本的 Windows 電腦上顯示這些裝置。

.ntamd64
請勿在執行 Windows XP 或更新版本的 Windows 的 x64 電腦上顯示這些裝置。

.ntarm
請勿在執行 Windows 8 或更新版本的 Windows 電腦上顯示這些裝置。

.ntarm64
請勿在執行 Windows 10 1709 版或更新版本的 Windows 的 Arm64 計算機上顯示這些裝置。

如需如何使用系統定義 .nt.ntx86.ntia64、.ntamd64.ntarm.ntarm64 延伸模組的詳細資訊,請參閱建立多個平臺和操作系統的 INF 檔案

CopyFilesOnly
只安裝指定裝置的 INF 指定檔案,因為裝置硬體尚無法存取或可供使用。

此專案很少使用。 不過,它可以用來預安裝裝置的驅動程式,而卡片稍後會放在目前使用中的特定插槽中。 例如,如果目前位於特定位置的裝置需要將 INF 指定的檔案傳送至目標,INF 就會有這個專案。

InteractiveInstall
強制在使用者的內容中安裝指定的裝置清單。 每一行都可以指定一或多個硬體標識碼或相容的標識碼,而且可以有一或多行。

這是選用項目。 安裝裝置的慣用方式是省略此專案,並允許 Windows 盡可能在受信任系統線程的內容中安裝裝置。 不過,如果裝置絕對需要使用者在安裝裝置時登入,請在裝置 INF 中包含這個專案。

RequestAdditionalSoftware
指定如果指定 *) 或指定的裝置清單可能需要比透過裝置驅動程式 套件 安裝的其他軟體,則所有 (。 例如, RequestAdditionalSoftware 專案可用來安裝驅動程式套件中未包含的新或更新裝置特定軟體。

注意

如果未指定 * , 則 RequestAdditionalSoftware 專案所指定的每個裝置都必須定義在 INF Models 區段中

此專案是選擇性專案,且在 Windows 7 到 1709 版 Windows 10 支援。

在 Windows 安裝裝置的驅動程式套件之後,如果 INF 檔案中指定 RequestAdditionalSoftware 專案,隨插即用 (PnP) 管理員會執行下列步驟:

  1. PnP 管理員會產生具有 RequestAdditionalSoftware 類型的問題報告和解決方案 (PRS) 錯誤報告。 此報告包含裝置的特定硬體識別碼和計算機系統架構的相關信息。

  2. 如果獨立硬體廠商提供的解決方案 (裝置特定軟體的 IHV) ,則會將解決方案下載到計算機。

    注意

    解決方案的下載不會安裝軟體本身。

  3. 如果電腦上未安裝裝置特定軟體,PnP 管理員會向使用者顯示解決方案,並提供下載軟體的連結。 然後,使用者可以依照解決方案中提供的指示,選擇下載並安裝此軟體。

備註

一般而言, ControlFlags 區段有一或多個 ExcludeFromSelect 專案,可識別個別製造商 INF Models 區段中所列的裝置,但不應該在手動安裝期間向用戶顯示為選項。

ExcludeFromSelect 專案中列出裝置的硬體識別碼相容識別碼,會將它從顯示的顯示中移除給使用者。 為 ExcludeFromSelect 值指定星號 (*) ,會從這個使用者可見清單中移除 INF 檔案中定義的所有裝置/模型。

INF 寫入器應該謹慎使用 InteractiveInstall 指示詞,而且只在下列情況下使用:

  • 安裝已損毀或未正確定義硬體標識碼之裝置的驅動程式。 例如,當兩個以上的不同裝置共用相同的硬體標識符時。 隨插即用 標準嚴格禁止這種情況,但有些硬體廠商已在硬體中發生此錯誤。
  • 若要為需要自己的驅動程式的裝置安裝驅動程式,而且絕對無法使用操作系統所提供的一般類別驅動程式或其他驅動程式。 InteractiveInstall 項目會強制 裝置管理員 要求使用者確認相容的標識符相符專案。

注意

未來,WHQL 可能不會將 Windows 標誌授與 INF 檔案包含 InteractiveInstall 專案的裝置。

獨佔安裝 PnP 裝置的 INF 檔案可以有 ControlFlags 區段,除非它們將其各自的裝置安裝類別 GUID 設定中的 NoInstallClass 值項目設定為 TRUE。 如需這些設定的詳細資訊,請參閱 INF ClassInstall32 一節

範例

系統滑鼠類別 INF 中的 ControlFlags 區段範例會隱藏無法在 x86 平臺上安裝的裝置/型號顯示。

[ControlFlags]
; Exclude all bus mice and InPort mice for x86 platforms
ExcludeFromSelect.ntx86=*PNP0F0D,*PNP0F11,*PNP0F00,*PNP0F02,*PNP0F15
; Hide this entry always
ExcludeFromSelect=UNKNOWN_MOUSE

下列 INF 檔案片段顯示兩個裝置:一個完全支援 PnP,且在安裝期間不需要使用者介入,另一個裝置需要自己的驅動程式,而且無法使用任何其他驅動程式。 為第二個裝置指定 InteractiveInstall 會強制 Windows 在使用者的內容中安裝此裝置, (具有系統管理許可權的使用者) 。 這包括提示用戶視需要 (INF 檔案、驅動程式檔案等) 驅動程式檔案的位置。

; ...
[Manufacturer]
%Mfg% = ModelsSection

[ModelsSection]
; Models section, with two entries
%Device1.DeviceDesc% = Device1.Install, \
    PCI\VEN_1000&DEV_0001&SUBSYS_00000000&REV_01
%Device2.Device.Desc%= Device2.Install, \
    PCI\VEN_1000&DEV_0001&SUBSYS_00000000&REV_02

[ControlFlags]
InteractiveInstall = \
  PCI\VEN_1000&DEV_0001&SUBSYS_00000000&REV_02
; ...

另請參閱

ClassInstall32

製造商

模型