Commit | Line | Data |
---|---|---|
09054f70 LOK |
1 | @echo off |
2 | ||
948ee14e LOK |
3 | set EXITCODE=1 |
4 | ||
4d760b54 | 5 | rem Check for NSIS |
7879fa15 LOK |
6 | IF EXIST "%ProgramFiles%\NSIS\makensis.exe" ( |
7 | set NSIS="%ProgramFiles%\NSIS\makensis.exe" | |
8 | ) ELSE IF EXIST "%ProgramFiles(x86)%\NSIS\makensis.exe" ( | |
9 | set NSIS="%ProgramFiles(x86)%\NSIS\makensis.exe" | |
10 | ) ELSE GOTO NONSIS | |
11 | ||
4d760b54 | 12 | rem Check for VC10 |
09054f70 | 13 | IF "%VS100COMNTOOLS%"=="" ( |
7879fa15 | 14 | set COMPILER10="%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" |
09054f70 | 15 | ) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\VCExpress.exe" ( |
7879fa15 | 16 | set COMPILER10="%VS100COMNTOOLS%\..\IDE\VCExpress.exe" |
09054f70 | 17 | ) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\devenv.exe" ( |
7879fa15 | 18 | set COMPILER10="%VS100COMNTOOLS%\..\IDE\devenv.exe" |
4d760b54 | 19 | ) ELSE GOTO NOSDK10 |
09054f70 | 20 | |
4d760b54 LOK |
21 | del /s /f /q ..\build |
22 | mkdir ..\build | |
8dfe215b | 23 | |
566a8c68 LOK |
24 | IF EXIST "..\support\p8-usbcec-driver-installer.exe" ( |
25 | copy "..\support\p8-usbcec-driver-installer.exe" "..\build\." | |
26 | ) ELSE ( | |
44f8f041 LOK |
27 | rem Check for the Windows DDK |
28 | IF NOT EXIST "C:\WinDDK\7600.16385.1" GOTO NODDK | |
29 | set DDK="C:\WinDDK\7600.16385.1" | |
30 | ||
566a8c68 LOK |
31 | call create-driver-installer.cmd |
32 | ) | |
8dfe215b | 33 | |
4d760b54 LOK |
34 | mkdir ..\build\x64 |
35 | ||
8dfe215b LOK |
36 | cd ..\project |
37 | ||
4d760b54 LOK |
38 | rem Skip to libCEC/x86 when we're running on win32 |
39 | if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto libcecx86 | |
f00ff009 | 40 | |
4d760b54 LOK |
41 | rem Compile libCEC and cec-client x64 |
42 | echo. Cleaning libCEC (x64) | |
f00ff009 | 43 | %COMPILER10% libcec.sln /clean "Release|x64" |
4d760b54 | 44 | echo. Compiling libCEC (x64) |
f00ff009 | 45 | %COMPILER10% libcec.sln /build "Release|x64" /project libcec |
4d760b54 | 46 | echo. Compiling cec-client (x64) |
f00ff009 | 47 | %COMPILER10% libcec.sln /build "Release|x64" /project testclient |
7879fa15 | 48 | |
4d760b54 LOK |
49 | :libcecx86 |
50 | rem Compile libCEC and cec-client Win32 | |
51 | echo. Cleaning libCEC (x86) | |
52 | %COMPILER10% libcec.sln /clean "Release|Win32" | |
53 | echo. Compiling libCEC (x86) | |
54 | %COMPILER10% libcec.sln /build "Release|Win32" /project libcec | |
55 | echo. Compiling cec-client (x86) | |
56 | %COMPILER10% libcec.sln /build "Release|Win32" /project testclient | |
57 | ||
58 | rem Check for VC9 | |
7879fa15 LOK |
59 | IF "%VS90COMNTOOLS%"=="" ( |
60 | set COMPILER9="%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\VCExpress.exe" | |
61 | ) ELSE IF EXIST "%VS90COMNTOOLS%\..\IDE\VCExpress.exe" ( | |
62 | set COMPILER9="%VS90COMNTOOLS%\..\IDE\VCExpress.exe" | |
63 | ) ELSE IF EXIST "%VS90COMNTOOLS%\..\IDE\devenv.exe" ( | |
64 | set COMPILER9="%VS90COMNTOOLS%\..\IDE\devenv.exe" | |
65 | ) ELSE GOTO NOSDK9 | |
66 | ||
4d760b54 LOK |
67 | rem Skip to libCEC/x86 when we're running on win32 |
68 | if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto libcecsharpx86 | |
f00ff009 | 69 | |
4d760b54 LOK |
70 | rem Compile LibCecSharp (x64) |
71 | echo. Cleaning LibCecSharp (x64) | |
f00ff009 | 72 | %COMPILER9% LibCecSharp.Net2.sln /clean "Release|x64" |
4d760b54 LOK |
73 | echo. Compiling LibCecSharp (x64) |
74 | %COMPILER9% LibCecSharp.sln /build "Release|x64" /project LibCecSharp | |
75 | %COMPILER9% LibCecSharp.sln /build "Release|x64" /project CecSharpTester | |
10c03f2c | 76 | %COMPILER9% LibCecSharp.sln /build "Release|x64" /project cec-config-gui |
4d760b54 LOK |
77 | |
78 | copy ..\build\LibCecSharp.dll ..\build\x64\LibCecSharp.dll | |
79 | copy ..\build\CecSharpTester.exe ..\build\x64\CecSharpTester.exe | |
10c03f2c | 80 | copy ..\build\cec-config-gui.exe ..\build\x64\cec-config-gui.exe |
4d760b54 LOK |
81 | |
82 | :libcecsharpx86 | |
83 | rem Compile LibCecSharp (x86) | |
84 | echo. Cleaning LibCecSharp (x86) | |
85 | %COMPILER9% LibCecSharp.sln /clean "Release|x86" | |
86 | echo. Compiling LibCecSharp (x86) | |
87 | %COMPILER9% LibCecSharp.sln /build "Release|x86" /project LibCecSharp | |
88 | %COMPILER9% LibCecSharp.sln /build "Release|x86" /project CecSharpTester | |
10c03f2c | 89 | %COMPILER9% LibCecSharp.sln /build "Release|x86" /project cec-config-gui |
09054f70 | 90 | |
7879fa15 | 91 | :NOSDK9 |
4d760b54 | 92 | rem Clean things up before creating the installer |
8dfe215b LOK |
93 | del /q /f ..\build\LibCecSharp.pdb |
94 | del /q /f ..\build\CecSharpTester.pdb | |
10c03f2c LOK |
95 | del /q /f ..\build\cec-config-gui.pdb |
96 | del /q /f ..\build\cec-config-gui.vshost.exe.manifest | |
97 | del /q /f ..\build\cec-config-gui.vshost.exe | |
4d760b54 | 98 | copy ..\build\cec-client.x64.exe ..\build\x64\cec-client.x64.exe |
8dfe215b | 99 | del /q /f ..\build\cec-client.x64.exe |
4d760b54 | 100 | copy ..\build\libcec.x64.dll ..\build\x64\libcec.x64.dll |
8dfe215b | 101 | del /q /f ..\build\libcec.x64.dll |
4d760b54 | 102 | copy ..\build\libcec.x64.lib ..\build\x64\libcec.x64.lib |
8dfe215b | 103 | del /q /f ..\build\libcec.x64.lib |
4d760b54 | 104 | |
7c6346eb LOK |
105 | rem Check for sign-binary.cmd, only present on the Pulse-Eight production build system |
106 | rem Calls signtool.exe and signs the DLLs with Pulse-Eight's code signing key | |
d05a1e9c | 107 | IF NOT EXIST "..\support\private\sign-binary.cmd" GOTO CREATEINSTALLER |
7c6346eb | 108 | echo. Signing all binaries |
d05a1e9c LOK |
109 | CALL ..\support\private\sign-binary.cmd ..\build\cec-client.exe |
110 | CALL ..\support\private\sign-binary.cmd ..\build\CecSharpTester.exe | |
111 | CALL ..\support\private\sign-binary.cmd ..\build\libcec.dll | |
112 | CALL ..\support\private\sign-binary.cmd ..\build\LibCecSharp.dll | |
113 | CALL ..\support\private\sign-binary.cmd ..\build\cec-config-gui.exe | |
114 | CALL ..\support\private\sign-binary.cmd ..\build\x64\cec-client.x64.exe | |
115 | CALL ..\support\private\sign-binary.cmd ..\build\x64\CecSharpTester.exe | |
116 | CALL ..\support\private\sign-binary.cmd ..\build\x64\libcec.x64.dll | |
117 | CALL ..\support\private\sign-binary.cmd ..\build\x64\LibCecSharp.dll | |
118 | CALL ..\support\private\sign-binary.cmd ..\build\x64\cec-config-gui.exe | |
7c6346eb LOK |
119 | |
120 | :CREATEINSTALLER | |
4d760b54 | 121 | echo. Creating the installer |
09054f70 LOK |
122 | %NSIS% /V1 /X"SetCompressor /FINAL lzma" "libCEC.nsi" |
123 | ||
7c6346eb LOK |
124 | IF NOT EXIST "..\build\libCEC-installer.exe" GOTO :ERRORCREATINGINSTALLER |
125 | ||
126 | rem Sign the installer if sign-binary.cmd exists | |
d05a1e9c | 127 | IF EXIST "..\support\private\sign-binary.cmd" ( |
7c6346eb | 128 | echo. Signing the installer binaries |
d05a1e9c | 129 | CALL ..\support\private\sign-binary.cmd ..\build\libCEC-installer.exe |
7c6346eb LOK |
130 | ) |
131 | ||
924a6975 LOK |
132 | IF "%1%"=="" ( |
133 | echo. The installer can be found here: ..\build\libCEC-installer.exe | |
134 | ) ELSE ( | |
135 | move ..\build\libCEC-installer.exe ..\build\libCEC-%1%-installer.exe | |
136 | echo. The installer can be found here: ..\build\libCEC-%1%-installer.exe | |
137 | ) | |
4d760b54 | 138 | |
948ee14e | 139 | set EXITCODE=0 |
4d760b54 | 140 | GOTO EXIT |
7879fa15 | 141 | |
4d760b54 LOK |
142 | :NOSDK10 |
143 | echo. Both Visual Studio 2010 and Visual C++ Express 2010 were not found on your system. | |
7879fa15 LOK |
144 | GOTO EXIT |
145 | ||
146 | :NOSIS | |
4d760b54 | 147 | echo. NSIS could not be found on your system. |
7879fa15 LOK |
148 | GOTO EXIT |
149 | ||
150 | :NODDK | |
4d760b54 | 151 | echo. Windows DDK could not be found on your system |
7c6346eb LOK |
152 | GOTO EXIT |
153 | ||
154 | :ERRORCREATINGINSTALLER | |
155 | echo. The installer could not be created. The most likely cause is that something went wrong while compiling. | |
7879fa15 | 156 | |
f00ff009 | 157 | :EXIT |
8dfe215b LOK |
158 | del /q /f ..\build\cec-client.exe |
159 | del /q /f ..\build\CecSharpTester.exe | |
10c03f2c | 160 | del /q /f ..\build\cec-config-gui.exe |
8dfe215b LOK |
161 | del /q /f ..\build\*.dll |
162 | del /q /f ..\build\*.lib | |
163 | del /q /f ..\build\*.exp | |
164 | del /s /f /q ..\build\x64 | |
165 | rmdir ..\build\x64 | |
44f8f041 LOK |
166 | cd ..\support |
167 | ||
948ee14e | 168 | exit %EXITCODE% |