; Copyright (C) u-blox AG
; Sensor Driver Installer for u-blox USB GNSS devices
;

[Version]
Signature	= "$Windows NT$"
Class		= Sensor
ClassGuid	= {5175D334-C371-4806-B3BA-71FD53C9258D}
Provider	= %SensorManufacturer%
DriverVer=01/20/2020,202.0.0.0
CatalogFile = WinGpsSensorDriver.cat

; =================== Manufacturer/Models sections =======================

[Manufacturer]
%SensorManufacturer%         = ublox,NTx86,NTamd64

[ublox.NTx86]
%ublox4GPS.DeviceDesc% = ublox4GPS_Install,USB\Vid_1546&Pid_01a4
%ublox5GPS.DeviceDesc% = ublox5GPS_Install,USB\Vid_1546&Pid_01a5
%ublox6GPS.DeviceDesc% = ublox6GPS_Install,USB\Vid_1546&Pid_01a6
%ublox7GPS.DeviceDesc% = ublox7GPS_Install,USB\Vid_1546&Pid_01a7
%ublox8GPS.DeviceDesc% = ublox8GPS_Install,USB\Vid_1546&Pid_01a8
%ublox7GPS.DeviceDesc% = ublox7GPS_Install,USB\Vid_1546&Pid_03a7&MI_00
%ublox8GPS.DeviceDesc% = ublox8GPS_Install,USB\Vid_1546&Pid_03a8&MI_00

[ublox.NTamd64]
%ublox4GPS.DeviceDesc% = ublox4GPS_Install,USB\Vid_1546&Pid_01a4
%ublox5GPS.DeviceDesc% = ublox5GPS_Install,USB\Vid_1546&Pid_01a5
%ublox6GPS.DeviceDesc% = ublox6GPS_Install,USB\Vid_1546&Pid_01a6
%ublox7GPS.DeviceDesc% = ublox7GPS_Install,USB\Vid_1546&Pid_01a7
%ublox8GPS.DeviceDesc% = ublox8GPS_Install,USB\Vid_1546&Pid_01a8
%ublox7GPS.DeviceDesc% = ublox7GPS_Install,USB\Vid_1546&Pid_03a7&MI_00
%ublox8GPS.DeviceDesc% = ublox8GPS_Install,USB\Vid_1546&Pid_03a8&MI_00

; =================== GPS Sensor Device ==================================

; =================== UMDF u-blox ANTARIS 4 GPS Receiver ==================================

[ublox4GPS_Install.NT]
CopyFiles       = UMDriverCopy, RMFiles
Include         = WINUSB.INF               ; Import sections from WINUSB.INF
Needs           = WINUSB.NT                ; Run the CopyFiles & AddReg directives for WinUsb.INF
AddProperty     = DriverPropertiesSection
AddReg          = ublox_Common_SW_AddReg

[ublox4GPS_Install.NT.hw]
AddReg=ublox_4_w7_Device_HW_AddReg
AddReg=ublox_Common_HW_AddReg

[ublox4GPS_Install.NT.Services]
AddService      = WUDFRd,0x000001fa,WUDFRD_ServiceInstall   ; flag 0x2 sets this as the service for the device
AddService      = WinUsb,0x000001f8,WinUsb_ServiceInstall   ; this service is installed because its a filter.

[ublox4GPS_Install.NT.Wdf]
KmdfService                = WINUSB, WinUsb_Install
UmdfDispatcher             = WinUsb
UmdfService                = ubloxGPS,UMDFubloxGPS_Install
UmdfServiceOrder           = ubloxGPS
UmdfImpersonationLevel     = Impersonation

[ublox4GPS_Install.NT.CoInstallers]
AddReg          = ubloxGPS_CoInstallers_AddReg
CopyFiles       = ubloxGPS_CoInstallers_CopyFiles

[ublox_4_w7_Device_HW_AddReg]
HKR,,"SensorFriendlyName",0,%ublox4GPS.DeviceDesc%

; =================== UMDF u-blox 5 GPS and GALILEO Receiver ==================================

[ublox5GPS_Install.NT]
CopyFiles       = UMDriverCopy, RMFiles
Include         = WINUSB.INF                      ; Import sections from WINUSB.INF
Needs           = WINUSB.NT                       ; Run the CopyFiles & AddReg directives for WinUsb.INF
AddProperty     = DriverPropertiesSection
AddReg          = ublox_Common_SW_AddReg

[ublox5GPS_Install.NT.hw]
AddReg=ublox_5_w7_Device_HW_AddReg
AddReg=ublox_Common_HW_AddReg

[ublox5GPS_Install.NT.Services]
AddService      = WUDFRd,0x000001fa,WUDFRD_ServiceInstall   ; flag 0x2 sets this as the service for the device
AddService      = WinUsb,0x000001f8,WinUsb_ServiceInstall  ; this service is installed because its a filter.

[ublox5GPS_Install.NT.Wdf]
KmdfService                = WINUSB, WinUsb_Install
UmdfDispatcher             = WinUsb
UmdfService                = ubloxGPS,UMDFubloxGPS_Install
UmdfServiceOrder           = ubloxGPS
UmdfImpersonationLevel     = Impersonation

[ublox5GPS_Install.NT.CoInstallers]
AddReg          = ubloxGPS_CoInstallers_AddReg
CopyFiles       = ubloxGPS_CoInstallers_CopyFiles

[ublox_5_w7_Device_HW_AddReg]
HKR,,"SensorFriendlyName",0,%ublox5GPS.DeviceDesc%

; =================== UMDF u-blox 6 GPS Receiver ==================================

[ublox6GPS_Install.NT]
CopyFiles       = UMDriverCopy, RMFiles
Include         = WINUSB.INF                      ; Import sections from WINUSB.INF
Needs           = WINUSB.NT                       ; Run the CopyFiles & AddReg directives for WinUsb.INF
AddProperty     = DriverPropertiesSection
AddReg          = ublox_Common_SW_AddReg

[ublox6GPS_Install.NT.hw]
AddReg=ublox_6_w7_Device_HW_AddReg
AddReg=ublox_Common_HW_AddReg

[ublox6GPS_Install.NT.Services]
AddService      = WUDFRd,0x000001fa,WUDFRD_ServiceInstall   ; flag 0x2 sets this as the service for the device
AddService      = WinUsb,0x000001f8,WinUsb_ServiceInstall  ; this service is installed because its a filter.

[ublox6GPS_Install.NT.Wdf]
KmdfService                = WINUSB, WinUsb_Install
UmdfDispatcher             = WinUsb
UmdfService                = ubloxGPS,UMDFubloxGPS_Install
UmdfServiceOrder           = ubloxGPS
UmdfImpersonationLevel     = Impersonation

[ublox6GPS_Install.NT.CoInstallers]
AddReg          = ubloxGPS_CoInstallers_AddReg
CopyFiles       = ubloxGPS_CoInstallers_CopyFiles

[ublox_6_w7_Device_HW_AddReg]
HKR,,"SensorFriendlyName",0,%ublox6GPS.DeviceDesc%


; =================== UMDF u-blox 7 GPS Receiver ==================================

[ublox7GPS_Install.NT]
CopyFiles       = UMDriverCopy, RMFiles
Include         = WINUSB.INF                      ; Import sections from WINUSB.INF
Needs           = WINUSB.NT                       ; Run the CopyFiles & AddReg directives for WinUsb.INF
AddProperty     = DriverPropertiesSection
AddReg          = ublox_Common_SW_AddReg

[ublox7GPS_Install.NT.hw]
AddReg=ublox_7_w7_Device_HW_AddReg
AddReg=ublox_Common_HW_AddReg

[ublox7GPS_Install.NT.Services]
AddService      = WUDFRd,0x000001fa,WUDFRD_ServiceInstall   ; flag 0x2 sets this as the service for the device
AddService      = WinUsb,0x000001f8,WinUsb_ServiceInstall  ; this service is installed because its a filter.

[ublox7GPS_Install.NT.Wdf]
KmdfService                = WINUSB, WinUsb_Install
UmdfDispatcher             = WinUsb
UmdfService                = ubloxGPS,UMDFubloxGPS_Install
UmdfServiceOrder           = ubloxGPS
UmdfImpersonationLevel     = Impersonation

[ublox7GPS_Install.NT.CoInstallers]
AddReg          = ubloxGPS_CoInstallers_AddReg
CopyFiles       = ubloxGPS_CoInstallers_CopyFiles

[ublox_7_w7_Device_HW_AddReg]
HKR,,"SensorFriendlyName",0,%ublox7GPS.DeviceDesc%


; =================== UMDF u-blox 8 GPS Receiver ==================================

[ublox8GPS_Install.NT]
CopyFiles       = UMDriverCopy, RMFiles
Include         = WINUSB.INF                      ; Import sections from WINUSB.INF
Needs           = WINUSB.NT                       ; Run the CopyFiles & AddReg directives for WinUsb.INF
AddProperty     = DriverPropertiesSection
AddReg          = ublox_Common_SW_AddReg

[ublox8GPS_Install.NT.hw]
AddReg=ublox_8_w7_Device_HW_AddReg
AddReg=ublox_Common_HW_AddReg

[ublox8GPS_Install.NT.Services]
AddService      = WUDFRd,0x000001fa,WUDFRD_ServiceInstall   ; flag 0x2 sets this as the service for the device
AddService      = WinUsb,0x000001f8,WinUsb_ServiceInstall  ; this service is installed because its a filter.

[ublox8GPS_Install.NT.Wdf]
KmdfService                = WINUSB, WinUsb_Install
UmdfDispatcher             = WinUsb
UmdfService                = ubloxGPS,UMDFubloxGPS_Install
UmdfServiceOrder           = ubloxGPS
UmdfImpersonationLevel     = Impersonation

[ublox8GPS_Install.NT.CoInstallers]
AddReg          = ubloxGPS_CoInstallers_AddReg
CopyFiles       = ubloxGPS_CoInstallers_CopyFiles

[ublox_8_w7_Device_HW_AddReg]
HKR,,"SensorFriendlyName",0,%ublox8GPS.DeviceDesc%


; =================== Addreg's common to all U-blox devices ===================

[ublox_Common_HW_AddReg]
HKR,WUDF,"UpperDriverOK",0x00010001,1
HKR,,"CreateLegacyPort",0x00010001,1
HKR,,"UseLegacyPort",0x00010001,1
HKR,,"LowerFilters",0x00010008,"WinUsb" ; FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND
HKR,,"WinUsbPowerPolicyOwnershipDisabled",0x00010001,1
HKR,,"DeviceIdleEnabled",0x00010001,1
HKR,,"DefaultIdleState",0x00010001,1
HKR,,"DefaultIdleTimeout",0x00010001,5000
HKR,,"UserSetDeviceIdleEnabled",0x00010001,1
HKR,,"IntervalSuspendThreshold",0x00010001,8
HKR,,"SensorID",0,%SensorID%
HKR,,"SensorDescription",0,%SensorDescription%
HKR,,"Manufacturer",0,%SensorManufacturer%
HKR,,"ProprietaryEvents",0x00010001,0 
HKCR, CLSID\{C85A4489-DB5E-4911-9C5A-B6B54C947A09}, "", 0x00000000, "Ubx Radio Manager"
HKCR, CLSID\{C85A4489-DB5E-4911-9C5A-B6B54C947A09}\InProcServer32, "", 0x00000000, "UbxRM.dll"
HKCR, CLSID\{C85A4489-DB5E-4911-9C5A-B6B54C947A09}\InProcServer32, "ThreadingModel", 0x00000000, "Both"
HKLM, SYSTEM\CurrentControlSet\Control\RadioManagement\{C85A4489-DB5E-4911-9C5A-B6B54C947A09}, ,0x00000000, "Ubx Radio Manager"

[ublox_Common_SW_AddReg]
; Nothing here yet.

; =================== UMDF Service Install section ===================

[UMDFubloxGPS_Install]
UmdfLibraryVersion      = 1.11.0
DriverCLSID             = {B98111D5-7DC2-4430-87D6-34E54C18E694}
ServiceBinary           = %12%\UMDF\WinGpsSensorDriver.dll

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

[SourceDisksFiles]
WinGpsSensorDriver.dll  = 1
WudfUpdate_01011.dll = 1
UbxRM.dll = 1
SensorCoInstaller2.dll = 1

[SourceDisksNames.x86]
1 = %MediaDescription%,,,\WinGpsSensorDriverX86

[SourceDisksNames.amd64]
1 = %MediaDescription%,,,\WinGpsSensorDriverX64

[WinUsb_Install]
KmdfLibraryVersion = 1.11

[WinUsb_ServiceInstall]
DisplayName     = %WinUsb_SvcDesc%
ServiceType     = 1
StartType       = 3
ErrorControl    = 1
ServiceBinary   = %12%\WinUSB.sys

[ubloxGPS_CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WUDFUpdate_01011.dll"

[ubloxGPS_CoInstallers_CopyFiles]
WudfUpdate_01011.dll
SensorCoInstaller2.dll

[DestinationDirs]
UMDriverCopy            = 12,UMDF
ubloxGPS_CoInstallers_CopyFiles = 11
RMFiles                 = 11

[UMDriverCopy]
WinGpsSensorDriver.dll

[RMFiles]
UbxRM.dll

; =================== Driver Property section ===================

[DriverPropertiesSection]
DeviceIcon,,,,"%11%\sensorscpl.dll,-1007"
;Custom Icon
;DeviceIcon,,,,"%12%\UMDF\WinGpsSensorDriver.dll,-1000"

; =================== Generic ==================================

[Strings]
MediaDescription            = "u-blox GPS Driver Installation Media"
ClassName                   = "u-blox GPS Driver"
WudfRdDisplayName           = "Windows Driver Foundation - User-mode Driver Framework Reflector"
ublox8GPS.DeviceDesc        = "u-blox GNSS Location Sensor" 
ublox7GPS.DeviceDesc        = "u-blox 7 GPS/GNSS Location Sensor" 
ublox6GPS.DeviceDesc        = "u-blox 6 GPS Location Sensor" 
ublox5GPS.DeviceDesc        = "u-blox 5 GPS and GALILEO Location Sensor" 
ublox4GPS.DeviceDesc        = "u-blox ANTARIS 4 GPS Location Sensor"
WinUsb_SvcDesc              = "WinUSB Driver"
SensorID                    = "GPS (u-blox)"
SensorDescription           = "u-blox GPS Sensor"
SensorManufacturer          = "u-blox"
