;
; FWVirtualInputDevice.inf
; Copyright © 2017 Endor AG;
; All rights reserved

; This file is used to install the Fanatec Wheel Virtual Mouse or Keyboard
;

[Version]
Signature="$WINDOWS NT$"
Class=%FANATECCLASS%
ClassGuid={07D6CF0D-8602-42e8-AB52-4829384E6E94}
Provider=%ManufacturerName%
CatalogFile=FWVirtualInputDevice.cat
; Manually change "Date(mm/dd/yyyy) and Product Version" only if FWVirtualInputDevice was modified.
DriverVer=10/05/2021,8.413.0.1

; ================= Class section =====================

[ClassInstall32]
Addreg=FanatecClassReg

[FanatecClassReg]
HKR,,,0,%FANATECCLASS%
HKR,,Icon,,-24
HKR,,NoDisplayClass,,1

[DestinationDirs]
DefaultDestDir = 12
FWVirtualMouse_Device_CoInstaller_CopyFiles = 11

[SourceDisksNames]
1 = %DiskName%,,,""

[SourceDisksFiles]
FWVirtualInputDevice.sys  = 1,,
WdfCoInstaller01011.dll=1 ; make sure the number matches with SourceDisksNames

[DriverCopyFiles]
FWVirtualInputDevice.sys,,,0x00000002; (COPYFLG_NOSKIP)

[DriverDeleteFiles]
FWVirtualInputDevice.sys

;*****************************************
; Install Section
;*****************************************
[Manufacturer]
%ManufacturerName%=Standard,NTx86,NTAMD64

[Standard.NTx86]
%MOUSE_DESCRIPTION%=FWVirtualMouse_Device, ROOT\FW_VMOUSE_HWID
%KEYB_DESCRIPTION%=FWVirtualKeyboard_Device, ROOT\FW_VKEYB_HWID

[Standard.NTAMD64]
%MOUSE_DESCRIPTION%=FWVirtualMouse_Device, ROOT\FW_VMOUSE_HWID
%KEYB_DESCRIPTION%=FWVirtualKeyboard_Device, ROOT\FW_VKEYB_HWID

;-------------- Driver Mouse installation
[FWVirtualMouse_Device.NT]
CopyFiles=DriverCopyFiles

[FWVirtualMouse_Device.nt.hw]
AddReg=DriverVmouseHwAddReg

[DriverVmouseHwAddReg]
HKR,,"UpperFilters",0x00010000,"mouclass" 

;-------------- Driver Keyboard installation
[FWVirtualKeyboard_Device.NT]
CopyFiles=DriverCopyFiles

[FWVirtualKeyboard_Device.nt.hw]
AddReg=DriverVKeyboardHwAddReg

[DriverVKeyboardHwAddReg]
HKR,,"UpperFilters",0x00010000,"kbdclass"

;-------------- Service Mouse installation
[FWVirtualMouse_Device.NT.Services]
AddService = FWVirtualInputDevice,%SPSVCINST_ASSOCSERVICE%, FWVirtualInputDevice_Service_Inst

;-------------- Service Keyboard installation
[FWVirtualKeyboard_Device.NT.Services]
AddService = FWVirtualInputDevice,%SPSVCINST_ASSOCSERVICE%, FWVirtualInputDevice_Service_Inst

; -------------- FWVirtualInputDevice driver install sections
[FWVirtualInputDevice_Service_Inst]
DisplayName    = %FWVirtualInputDevice.SVCDESC%
ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
StartType      = 3               ; SERVICE_DEMAND_START
ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\FWVirtualInputDevice.sys
LoadOrderGroup = Extended Base

;
;--- Mouse or Keyboard Coinstaller installation ------
;
[FWVirtualMouse_Device.NT.CoInstallers]
AddReg=FWVirtualInputDevice_Device_CoInstaller_AddReg
CopyFiles=FWVirtualInputDevice_Device_CoInstaller_CopyFiles

[FWVirtualKeyboard_Device.NT.CoInstallers]
AddReg=FWVirtualInputDevice_Device_CoInstaller_AddReg
CopyFiles=FWVirtualInputDevice_Device_CoInstaller_CopyFiles

[FWVirtualInputDevice_Device_CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller01011.dll,WdfCoInstaller"

[FWVirtualInputDevice_Device_CoInstaller_CopyFiles]
WdfCoInstaller01011.dll

;-------------- Device  mouse or Keyboard WDF installation
[FWVirtualMouse_Device.NT.Wdf]
KmdfService =  FWVirtualInputDevice, FWVirtualInputDevice_wdfsect

[FWVirtualKeyboard_Device.NT.Wdf]
KmdfService =  FWVirtualInputDevice, FWVirtualInputDevice_wdfsect

[FWVirtualInputDevice_wdfsect]
KmdfLibraryVersion = 1.11

;-------------- General uninstallation
[DefaultUninstall.NTx86]
DelFiles=DriverDeleteFiles

[DefaultUninstall.NTAMD64]
DelFiles=DriverDeleteFiles

[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ManufacturerName="Endor AG" ; TODO: add ManufacturerName
FANATECCLASS="FANATEC Gaming Devices"
DiskName = "FANATEC INSTALLATION DISK"
MOUSE_DESCRIPTION="Fanatec Wheel Virtual Mouse"
KEYB_DESCRIPTION="Fanatec Wheel Virtual Keyboard"
FWVirtualInputDevice.SVCDESC = "FWVirtualInputDevice Service"
