Imported Upstream version 2.2.0
[deb_libcec.git] / support / create-driver-installer.cmd
CommitLineData
cbbe90dd
JB
1@echo off
2
3rem Check for NSIS
4IF EXIST "%ProgramFiles%\NSIS\makensis.exe" (
5 set NSIS="%ProgramFiles%\NSIS\makensis.exe"
6) ELSE IF EXIST "%ProgramFiles(x86)%\NSIS\makensis.exe" (
7 set NSIS="%ProgramFiles(x86)%\NSIS\makensis.exe"
8) ELSE GOTO NONSIS
9
10rem Check for the Windows DDK
11IF NOT EXIST "C:\WinDDK\7600.16385.1" GOTO NODDK
12set DDK="C:\WinDDK\7600.16385.1"
13
14mkdir ..\build
15
16echo. Copying driver installer
17copy "%DDK%\redist\DIFx\dpinst\MultiLin\amd64\dpinst.exe" ..\build\dpinst-amd64.exe
18copy "%DDK%\redist\DIFx\dpinst\MultiLin\x86\dpinst.exe" ..\build\dpinst-x86.exe
19
20:CREATECAT
21cd ..\driver
22IF EXIST "..\support\private\create-cat.cmd" (
23 echo. Updating the catalogue
24 CALL ..\support\private\create-cat.cmd p8usb-cec.cat
25)
26
27:CREATEINSTALLER
28echo. Creating the installer
29cd ..\project
30%NSIS% /V1 /X"SetCompressor /FINAL lzma" "p8-usbcec-driver.nsi"
31
32IF NOT EXIST "..\build\p8-usbcec-driver-installer.exe" GOTO :ERRORCREATINGINSTALLER
33
34rem Sign the installer if sign-binary.cmd exists
35IF EXIST "..\support\private\sign-binary.cmd" (
36 echo. Signing the installer binaries
37 CALL ..\support\private\sign-binary.cmd ..\build\p8-usbcec-driver-installer.exe
38)
39
40echo. The installer can be found here: ..\build\p8-usbcec-driver-installer.exe
41
42GOTO EXIT
43
44:NOSIS
45echo. NSIS could not be found on your system.
46GOTO EXIT
47
48:NODDK
49echo. Windows DDK could not be found on your system
50GOTO EXIT
51
52:ERRORCREATINGINSTALLER
53echo. The installer could not be created.
54
55:EXIT
56del /q /f ..\build\dpinst-amd64.exe
57del /q /f ..\build\dpinst-x86.exe
58cd ..\support