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