cec: added a little extra warning in support/cec-flash-device.sh
[deb_libcec.git] / support / create-installer.cmd
... / ...
CommitLineData
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
14rem Check for VC10
15IF "%VS100COMNTOOLS%"=="" (
16 set COMPILER10="%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe"
17) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\VCExpress.exe" (
18 set COMPILER10="%VS100COMNTOOLS%\..\IDE\VCExpress.exe"
19) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\devenv.exe" (
20 set COMPILER10="%VS100COMNTOOLS%\..\IDE\devenv.exe"
21) ELSE GOTO NOSDK10
22
23cd ..\project
24
25del /s /f /q ..\build
26mkdir ..\build
27mkdir ..\build\x64
28
29rem Skip to libCEC/x86 when we're running on win32
30if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto libcecx86
31
32rem Compile libCEC and cec-client x64
33echo. Cleaning libCEC (x64)
34%COMPILER10% libcec.sln /clean "Release|x64"
35echo. Compiling libCEC (x64)
36%COMPILER10% libcec.sln /build "Release|x64" /project libcec
37echo. Compiling cec-client (x64)
38%COMPILER10% libcec.sln /build "Release|x64" /project testclient
39
40:libcecx86
41rem Compile libCEC and cec-client Win32
42echo. Cleaning libCEC (x86)
43%COMPILER10% libcec.sln /clean "Release|Win32"
44echo. Compiling libCEC (x86)
45%COMPILER10% libcec.sln /build "Release|Win32" /project libcec
46echo. Compiling cec-client (x86)
47%COMPILER10% libcec.sln /build "Release|Win32" /project testclient
48
49rem Check for VC9
50IF "%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
58rem Skip to libCEC/x86 when we're running on win32
59if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto libcecsharpx86
60
61rem Compile LibCecSharp (x64)
62echo. Cleaning LibCecSharp (x64)
63%COMPILER9% LibCecSharp.Net2.sln /clean "Release|x64"
64echo. Compiling LibCecSharp (x64)
65%COMPILER9% LibCecSharp.sln /build "Release|x64" /project LibCecSharp
66%COMPILER9% LibCecSharp.sln /build "Release|x64" /project CecSharpTester
67
68copy ..\build\LibCecSharp.dll ..\build\x64\LibCecSharp.dll
69copy ..\build\CecSharpTester.exe ..\build\x64\CecSharpTester.exe
70
71:libcecsharpx86
72rem Compile LibCecSharp (x86)
73echo. Cleaning LibCecSharp (x86)
74%COMPILER9% LibCecSharp.sln /clean "Release|x86"
75echo. Compiling LibCecSharp (x86)
76%COMPILER9% LibCecSharp.sln /build "Release|x86" /project LibCecSharp
77%COMPILER9% LibCecSharp.sln /build "Release|x86" /project CecSharpTester
78
79:NOSDK9
80:CREATEINSTALLER
81echo. Copying driver installer
82copy "%DDK%\redist\DIFx\dpinst\MultiLin\amd64\dpinst.exe" ..\build\dpinst-amd64.exe
83copy "%DDK%\redist\DIFx\dpinst\MultiLin\x86\dpinst.exe" ..\build\dpinst-x86.exe
84
85rem Clean things up before creating the installer
86del ..\build\LibCecSharp.pdb
87del ..\build\CecSharpTester.pdb
88copy ..\build\cec-client.x64.exe ..\build\x64\cec-client.x64.exe
89del ..\build\cec-client.x64.exe
90copy ..\build\libcec.x64.dll ..\build\x64\libcec.x64.dll
91del ..\build\libcec.x64.dll
92copy ..\build\libcec.x64.lib ..\build\x64\libcec.x64.lib
93del ..\build\libcec.x64.lib
94
95echo. Creating the installer
96%NSIS% /V1 /X"SetCompressor /FINAL lzma" "libCEC.nsi"
97
98echo. The installer can be found here: ..\build\libCEC-installer.exe
99
100GOTO EXIT
101
102:NOSDK10
103echo. Both Visual Studio 2010 and Visual C++ Express 2010 were not found on your system.
104GOTO EXIT
105
106:NOSIS
107echo. NSIS could not be found on your system.
108GOTO EXIT
109
110:NODDK
111echo. Windows DDK could not be found on your system
112
113:EXIT