;
; PTUpdateFlashDriver.inf
;

[Version]
Signature="$Windows NT$"
Class=Firmware
ClassGuid={f2e7dd72-6468-4e36-b6f1-6488f42c1b52}
Provider=%ManufacturerName%
CatalogFile=PTUpdateFlashDriver.cat
DriverVer = 09/28/2021,58.2.96.5

[DestinationDirs]
DriversDir		= 12,UMDF		; copy to drivers\umdf
FirmwareDir		= 10,Firmware		; %SystemRoot%\Firmware

[SourceDisksNames]
1			= %DiskName%

[SourceDisksFiles]
PTUpdateFlashDriver.dll	= 1
UNIWILL_1836_T58_F96_P05.bin = 1
;*****************************************
; Install Section
;*****************************************

[Manufacturer]
%ManufacturerName%	= Standard,NTamd64

[Standard.NTamd64]
%DeviceName%		= PixArtHIDFirmwareUpdater, SWC\PTFlashUpdater

[PixArtHIDFirmwareUpdater.NT]
CopyFiles		= DriversDir,FirmwareDir
AddReg			= SettingsAddReg,FirmwareAddReg

[DriversDir]
PTUpdateFlashDriver.dll

[FirmwareDir]
%FirmwareFileName3A%,,,0x00000001

;*****************************************
; UMDF Device
;*****************************************

[PixArtHIDFirmwareUpdater.NT.hw]

[PixArtHIDFirmwareUpdater.NT.Services]
AddService		= WUDFRd,0x000001fa,WUDFRD_ServiceInstall

[PixArtHIDFirmwareUpdater.NT.Wdf]
UmdfService		= PTUpdateFlashDriver,PTUpdateFlashDriverInstall
UmdfServiceOrder	= PTUpdateFlashDriver

[PTUpdateFlashDriverInstall]
UmdfLibraryVersion	= 2.15.0 
ServiceBinary		= %12%\UMDF\PTUpdateFlashDriver.dll

[WUDFRD_ServiceInstall]
DisplayName		= %WudfRdDisplayName%
ServiceType		= 1
StartType		= 3
ErrorControl		= 1
ServiceBinary		= %12%\WUDFRd.sys

;*****************************************
; Firmware Update Section
;*****************************************

[FirmwareAddReg]
; Store location of firmware payload
HKR,,FirmwareFilename3A,,"%%SystemRoot%%\Firmware\%FirmwareFileName3A%"

;*****************************************
; Settings Section
;*****************************************

[SettingsAddReg]
; The target IC should be an unsigned short number
HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\WUDF\Services\PTUpdateFlashDriver\Parameters,TargetIC, 0x00010001, 0x0255
; The model type should be a byte number
HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\WUDF\Services\PTUpdateFlashDriver\Parameters,ModelType3A, 0x00010001, 0x3A

; The version should be an unsigned short number
HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\WUDF\Services\PTUpdateFlashDriver\Parameters,FirmwareVersion3A, 0x00010001, 0x6005

; The update rules should be a byte number
HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\WUDF\Services\PTUpdateFlashDriver\Parameters,ComparisonRule3A, 0x00010001, 0x02

; Firmware File Name
HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\WUDF\Services\PTUpdateFlashDriver\Parameters,FirmwareFileName3A, 0x00000000, %FirmwareFileName3A%

;*****************************************
; Strings
;*****************************************

[Strings]
ManufacturerName	= "PixArt Imaging Inc."
DiskName		= "PTUpdateFlashDriver Installation Disk"
WudfRdDisplayName	= "Windows Driver Foundation - User-mode Driver Framework Reflector"
DeviceName		= "PixArt HID Firmware Updater"
FirmwareFileName3A	= "UNIWILL_1836_T58_F96_P05.bin"