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