INF DDInstall 區段

每個模型 DDInstall 區段都包含選擇性 DriverVer 指示詞,以及一或多個參考 INF 檔案中其他具名區段的指示詞,如下所示,其中列出最常指定的 INF 指示詞 CopyFilesAddReg

這些指示詞所參考的區段包含安裝驅動程式檔案,以及將任何裝置特定和/或驅動程式特定資訊寫入登錄的指示。

[install-section-name] | 
[install-section-name.nt] | 
[install-section-name.ntx86] | 
[install-section-name.ntia64] | (Windows XP and later versions of Windows)
[install-section-name.ntamd64] | (Windows XP and later versions of Windows)
[install-section-name.ntarm] | (Windows 8 and later versions of Windows)
[install-section-name.ntarm64] (Windows 10 version 1709 and later versions of Windows)

[DriverVer=mm/dd/yyyy[,x.y.v.z]]
[CopyFiles=@filename | file-list-section[,file-list-section] ...]
[CopyINF=filename1.inf[,filename2.inf]...] (Windows XP and later versions of Windows)
[AddReg=add-registry-section[,add-registry-section]...]
[AddProperty=add-property-section[,add-property-section]...] (Windows Vista and later versions of Windows)
[Include=filename1.inf[,filename2.inf]...]
[Needs=inf-section-name[,inf-section-name]...]
[Delfiles=file-list-section[,file-list-section]...]
[Renfiles=file-list-section[,file-list-section]...]
[DelReg=del-registry-section[,del-registry-section]...]
[DelProperty=del-property-section[,del-property-section]...] (Windows Vista and later versions of Windows)
[FeatureScore=featurescore]... (Windows Vista and later versions of Windows)
[BitReg=bit-registry-section[,bit-registry-section]...]
[LogConfig=log-config-section[,log-config-section]...]
[ProfileItems=profile-items-section[,profile-items-section]...] (Windows 2000 and later versions of Windows)
[UpdateInis=update-ini-section[,update-ini-section]...]
[UpdateIniFields=update-inifields-section[,update-inifields-section]...]
[Ini2Reg=ini-to-registry-section[,ini-to-registry-section]...]
[RegisterDlls=register-dll-section[,register-dll-section]...]
[UnregisterDlls=unregister-dll-section[,unregister-dll-section]...]
[ExcludeID=device-identification-string[,device-identification-string]...]... ((Windows XP and later versions of Windows)
[Reboot]

項目

通用 INF 不支援所有有效的專案。 下列列出哪些指示詞在通用 INF 中有效,以及哪些指示詞無效。

通用 INF 中支援

DriverVer=mm/dd/yyyy[,x.y.v.z]
這個選擇性專案會指定 驅動程式套件的版本資訊。

如需如何指定這個項目的詳細資訊,請參閱 INF DriverVer 指示詞

CopyFiles=@filename | file-list-section[,file-list-section] ...
這個指示詞會指定要從來源媒體複製到目的地的一個具名檔案,或參考指定來源媒體上裝置相關檔案的一或多個 INF 寫入器定義區段,以便傳送至目的地。 CopyFiles 指示詞是選擇性的,但存在於大部分的 DDInstall 區段中。

INF 之 DestinationDirs 區段中的 DefaultDestDir 專案會指定要複製之任何單一檔案的目的地。 SourceDisksNamesSourceDisksFiles區段,或在此 INF 版本區段的 LayoutFile 專案中指定的其他 INF,提供驅動程式檔案的散發媒體位置。

如需詳細資訊,請參閱 INF CopyFiles 指示詞

CopyINF=filename1.inf[,filename2.inf]...
(Windows XP 和更新版本) 此指示詞會導致指定的 INF 檔案複製到目標系統。

如需詳細資訊,請參閱 INF CopyINF 指示詞

AddReg=add-registry-section[,add-registry-section]...
這個指示詞會參考一或多個 INF 寫入器定義的區段,其中新的子機碼可能是初始值專案,會指定為寫入登錄或修改現有索引鍵的值專案。

這類 add-registry 區段中的 HKR 規格會指定所安裝裝置的 「軟體機碼」 登錄路徑。

如需詳細資訊,請參閱 INF AddReg 指示詞

AddProperty=add-property-section[,add-property-section]...
(Windows Vista 和更新版本) 參考一或多個 INF 檔案區段,以修改為裝置實例設定的 裝置屬性 。 您應該只使用 INF AddProperty 指示詞 來設定 Windows Vista 或更新版本的 Windows 操作系統的裝置實例屬性。

對於先前在 Windows Server 2003、Windows XP 或 Windows 2000 上引進且具有對應登錄專案值的裝置實例屬性,您應該繼續使用 INF AddReg 指示 詞來設定裝置實例屬性。 這些指導方針適用於系統定義的屬性和自定義屬性。 如需如何使用 AddProperty 指示詞的詳細資訊,請參閱 使用 INF AddProperty 指示詞和 INF DelProperty 指示詞。

Include=filename1.inf[,filename2.inf]...
這個選擇性專案會指定一或多個額外的系統提供的 INF 檔案,其中包含安裝此裝置和/或驅動程式所需的區段。 如果指定此專案,通常是 需求 專案。

例如,視系統核心串流支援而定之設備驅動器的 INF 檔案可能會指定此專案,如下所示:

Include= ks.inf, kscaptur.inf, ksfilter.inf

Needs=inf-section-name[,inf-section-name]...
這個選擇性專案會指定系統提供 INF 檔案內的區段,這些區段必須在安裝此裝置期間進行處理。 一般而言,這類具名區段是 DDInstall (或 DDInstallxxx) 包含在 Include 專案所列其中一個 INF 檔案內的區段。 不過,它可以是這類 DDInstall 或 DDInstall 內所參考的任何區段含 INF 的 xxx 區段。

例如,具有上述 Include 專案之設備驅動器的 INF 檔案可以指定這個專案,如下所示:

Needs= KS.Registration, KSCAPTUR.Registration.NT, MSPCLOCK.Installation

FeatureScore=featurescore

警告

只有在直接在 [DDInstall] 區段中指定時,才會處理 FeatureScore 指示詞。

(Windows Vista 和更新版本) 此指示詞會根據驅動程式支援的功能,提供驅動程式的額外排名準則。 例如,可能會針對 裝置安裝類別 定義功能分數,以根據類別特定準則區分驅動程式。

如需驅動程式排名方式的詳細資訊,請參閱 Windows 排名驅動程式如何 (Windows Vista 和更新版本)

如需此指示詞的詳細資訊,請參閱 INF FeatureScore 指示詞

注意

雖然 DDInstall 區段可以包含多個 FeatureScore 專案,但只會處理區段的第一個專案。

ExcludeID=device-identification-string[,device-identification-string]...

警告

只有在直接在 [DDInstall] 區段中指定時,才會處理 ExcludeID 指示詞。

(Windows XP 和更新版本) 此指示詞會指定一或多個裝置識別碼, (硬體 識別碼或 相容的 標識碼) 。 DDInstall 區段不會安裝裝置標識碼符合所列任何硬體標識碼或相容標識碼的裝置

重新啟動
這個指示詞表示在安裝完成之後,應該提示呼叫端重新啟動系統。

如需詳細資訊,請參閱 INF 重新啟動指示詞

通用 INF 不支援

Delfiles=file-list-section[,file-list-section]...
此指示詞會參考一或多個 INF 寫入器定義的區段,列出要刪除之目標上的檔案。

如需詳細資訊,請參閱 INF DelFiles 指示詞

Renfiles=file-list-section[,file-list-section]...
這個指示詞會參考一或多個 INF 寫入器定義的區段,列出在目的地上要重新命名的檔案,然後再將裝置相關的來源檔案複製到目標計算機。

如需詳細資訊,請參閱 INF RenFiles 指示詞

DelReg=del-registry-section[,del-registry-section]...
這個指示詞會參考一或多個 INF 寫入器定義的區段,其中會指定索引鍵和/或值專案,以在裝置安裝期間從登錄中移除。

一般而言,當 INF 必須清除先前安裝此裝置的舊登錄專案時,這個指示詞是用來處理升級。

這類 delete-registry 區段中的 HKR 規格會指定所安裝裝置的 「軟體機碼」 登錄路徑。

如需詳細資訊,請參閱 INF DelReg 指示詞

DelProperty=del-property-section[,del-property-section]...
(Windows Vista 和更新版本) 參考一或多個 INF 檔案區段,以刪除為裝置實例設定的 裝置屬性 。 您應該只使用 INF DelProperty 指示詞 來刪除 Windows Vista 或更新版本的 Windows 新增裝置實例屬性。

對於先前在 Windows Server 2003、Windows XP 或 Windows 2000 上引進且具有對應登錄專案值的裝置實例屬性,您應該繼續使用 INF DelReg 指示 詞來刪除裝置實例屬性。 這些指導方針適用於系統定義的屬性和自定義屬性。 如需如何使用 DelProperty 指示詞的詳細資訊,請參閱 使用 INF AddProperty 指示詞和 INF DelProperty 指示詞。

BitReg=bit-registry-section[,bit-registry-section]...
這個指示詞會參考一或多個 INF 寫入器定義的區段,其中修改了類型 REG_BINARY 的現有登錄值專案。

這類位登錄區段中的 HKR 規格會指定所安裝裝置的 「軟體機碼」 登錄路徑。

如需詳細資訊,請參閱 INF BitReg 指示詞

LogConfig=log-config-section[,log-config-section]...
這個指示詞會參考 INF 內一或多個 INF 寫入器定義的區段,以取得根列舉裝置或手動安裝的裝置。 在這些具名區段中,這類「偵測到」或手動安裝的裝置 INF 會指定裝置必須運作的一或多個總線相對硬體資源的邏輯設定。 無法設定軟體之這類手動安裝的裝置 INF 也應該具有 DDInstall。FactDef 區段。

LogConfig 指示詞永遠不會用來安裝 隨插即用 (PnP) 裝置。 不過,您可以使用 INF DDInstall.LogConfigOverride 區段 來提供 PnP 裝置的覆寫設定。

此指示詞與所有較高層級 (非裝置無關) 驅動程式和元件。

如需詳細資訊,請參閱 INF LogConfig 指示詞

ProfileItems=profile-items-section[,profile-items-section]...
(Microsoft Windows 2000 和更新版本的 Windows) 這個很少使用的指示詞會參考一或多個 INF 寫入器定義的區段,這些區段描述要加入或移除的 [開始] 功能表。

如需詳細資訊,請參閱 INF ProfileItems 指示詞

UpdateInis=update-ini-section[,update-ini-section]...
這個很少使用的指示詞會參考一或多個 INF 寫入器定義的區段,並指定來源 INI 檔案,讓這類區段內的特定區段或行在安裝期間讀入相同名稱的目的地 INI 檔案。 您也可以在 update-ini 區段中指定相同名稱的指定來源 INI 檔案,對目的地上現有 INI 檔案進行逐行修改。

如需詳細資訊,請參閱 INF UpdateInis 指示詞

UpdateIniFields=update-inifields-section[,update-inifields-section]...
這個很少使用的指示詞會參考一或多個 INF 寫入器定義的區段,其中指定了裝置特定 INI 檔案行內的修改。

如需詳細資訊,請參閱 INF UpdateIniFields 指示詞

Ini2Reg=ini-to-registry-section[,ini-to-registry-section]...
這個很少使用的指示詞會參考一或多個 INF 寫入器定義的區段,其中來自來源媒體上提供之裝置特定 INI 檔案的區段或行,將會移至登錄中。

如需詳細資訊,請參閱 INF Ini2Reg 指示詞

RegisterDlls=register-dll-section[,register-dll-section]...
此指示詞會參考一或多個 INF 區段,用來指定 OLE 控件的檔案,而且需要自我註冊。

如需詳細資訊,請參閱 INF RegisterDlls 指示詞

UnregisterDlls=unregister-dll-section[,unregister-dll-section]...
此指示詞會參考一或多個 INF 區段,這些區段用來指定 OLE 控件的檔案,而且需要自我取消註冊 (自我移除) 。

如需詳細資訊,請參閱 INF UnregisterDlls 指示詞

備註

在整個 Windows 驅動程式套件 (WDK) 檔中, DDInstall 一詞是用來參考 install-section-name,不含平臺延伸模組。 因此,“DDInstall 區段” 表示“INF 內的具名區段,格式為 [install-section-name] 或 [install-section-name.ntxxx]”。 當您建立 DDInstall 區段的名稱時,應該包含裝置特定的前置詞,例如 [WDMPNPB003_Device][GPR400。Install.NT]

每個 DDInstall 區段都必須在 INF 檔案的個別製造商 INF 模型 區段 下的裝置/模型特定項目中參考。

除了沒有從來源媒體傳輸相關聯檔案的裝置之外,在不同操作系統平臺上安裝WDM驅動程式的 INF 檔案必須至少有下列其中一個 DDInstall 區段:

  • install-section-name.ntx86 區段,指定 x86 平臺專屬的裝置/驅動程式安裝專案。
  • install-section-name.ntia64 區段,指定 Itanium 型平臺專屬的裝置/驅動程式安裝專案。
  • install-section-name.ntamd64 區段,指定 x64 型平臺專屬的裝置/驅動程式安裝專案。
  • install-section-name.ntarm 區段,指定 Arm 型平臺專屬的裝置/驅動程式安裝專案。
  • install-section-name.ntarm64 區段,指定 Arm64 架構平臺專屬的裝置/驅動程式安裝專案。
  • install-section-nameinstall-section-name.nt 區段,指定不是特定硬體平台專屬之裝置/驅動程式安裝的專案。

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

從 Windows 2000 開始,安裝驅動程式的 INF 檔案必須有 DDInstall.Services 區段,才能指定驅動程式服務資訊。

DDInstall 區段中的每個指示詞都可以參考多個區段名稱。 不過,每個額外的具名區段都必須以逗號分隔 (,) 。

每個區段名稱在 INF 檔案內必須是唯一的,而且必須遵循定義區段名稱的一般規則。 如需這些規則的詳細資訊,請參閱 INF 檔案的一般語法規則

假設在 DDInstall 區段中指定的任何 AddReg 指示詞都參考了 add-registry 區段,該區段無法用來儲存上層或下層篩選驅動程式、關於多函式裝置的相關信息,或有關與驅動程式無關但裝置特定的參數。 如果裝置/驅動程式 INF 必須將這種類型的資訊儲存在登錄中,則必須在其未重設且裝飾的 DDInstall 中使用 AddReg 指示詞如果有的話,HW 區段會參考另一個 INF-writer-defined add-registry-section

根據 INF 版本區段中指定的裝置安裝類別,可以在 DDInstall 區段中指定其他類別特定指示詞。 如需類別特定指示詞的詳細資訊,請參閱下列主題:

範例

此範例顯示 DDInstall 區段的擴充, Ser_InstInp_Inst。 這些區 段會在 INF 模型 區段的範例中參考。

[Ser_Inst]
CopyFiles=Ser_CopyFiles, mouclass_CopyFiles

[Ser_CopyFiles]
sermouse.sys

[mouclass_CopyFiles] ; section name referenced by > 1 CopyFiles
mouclass.sys

[Inp_Inst]
CopyFiles=Inp_CopyFiles, mouclass_CopyFiles

[Inp_CopyFiles]
inport.sys

下列範例顯示 INF 檔案的 DDInstall 區段,該檔案會在各種作業系統平臺上安裝音訊裝置的系統提供的 WDM 驅動程式:

[WDMPNPB003_Device.NT]
Include=ks.inf, wdmaudio.inf
Needs=KS.Registration, WDMAUDIO.Registration.NT
CopyFiles=MSSB16.CopyList
AddReg=WDM_SB16.AddReg

下列範例顯示系統提供的 ks.infwdmaudio.inf 檔案中上述 Needs 專案所參考的區段。 在上述範例中,這些檔案是在 Include 專案中指定。 當操作系統的裝置安裝程序處理此裝置的 install-section-name 時。nt 區段,也會處理接下來兩個區段。

[KS.Registration]
; following AddReg= is actually a single line in the ks.inf file
AddReg=ProxyRegistration,CategoryRegistration,\
    TopologyNodeRegistration,PlugInRegistration,PinNameRegistration,\
    DeviceRegistration 
CopyFiles=KSProxy.Files,KSDriver.Files

[WDMAUDIO.Registration.NT]
AddReg=WDM.AddReg
CopyFiles=WDM.CopyFiles.Sys, WDM.CopyFiles.Drv
;
; INF-writer-defined add-registry and file-list sections
; referenced by preceding directives are omitted here for brevity
;

另請參閱

AddProperty

DDInstall。CoInstallers

DDInstall。FactDef

DDInstall。硬體

DDInstall。介面

DDInstall。LogConfigOverride

DDInstall。服務

DefaultInstall

DefaultInstall.Services

DelProperty

FeatureScore