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