cec: only target .net 2.0, include all the new stuff in the installer
[deb_libcec.git] / project / create-installer.cmd
CommitLineData
09054f70
LOK
1@echo off
2
4d760b54 3rem Check for NSIS
7879fa15
LOK
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
4d760b54 10rem Check for the Windows DDK
7879fa15
LOK
11IF NOT EXIST "C:\WinDDK\7600.16385.1" GOTO NODDK
12set DDK="C:\WinDDK\7600.16385.1"
09054f70 13
4d760b54 14rem Check for VC10
09054f70 15IF "%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
23del /s /f /q ..\build
24mkdir ..\build
25mkdir ..\build\x64
26
27rem Skip to libCEC/x86 when we're running on win32
28if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto libcecx86
f00ff009 29
4d760b54
LOK
30rem Compile libCEC and cec-client x64
31echo. Cleaning libCEC (x64)
f00ff009 32%COMPILER10% libcec.sln /clean "Release|x64"
4d760b54 33echo. Compiling libCEC (x64)
f00ff009 34%COMPILER10% libcec.sln /build "Release|x64" /project libcec
4d760b54 35echo. Compiling cec-client (x64)
f00ff009 36%COMPILER10% libcec.sln /build "Release|x64" /project testclient
7879fa15 37
4d760b54
LOK
38:libcecx86
39rem Compile libCEC and cec-client Win32
40echo. Cleaning libCEC (x86)
41%COMPILER10% libcec.sln /clean "Release|Win32"
42echo. Compiling libCEC (x86)
43%COMPILER10% libcec.sln /build "Release|Win32" /project libcec
44echo. Compiling cec-client (x86)
45%COMPILER10% libcec.sln /build "Release|Win32" /project testclient
46
47rem Check for VC9
7879fa15
LOK
48IF "%VS90COMNTOOLS%"=="" (
49 set COMPILER9="%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\VCExpress.exe"
50) ELSE IF EXIST "%VS90COMNTOOLS%\..\IDE\VCExpress.exe" (
51 set COMPILER9="%VS90COMNTOOLS%\..\IDE\VCExpress.exe"
52) ELSE IF EXIST "%VS90COMNTOOLS%\..\IDE\devenv.exe" (
53 set COMPILER9="%VS90COMNTOOLS%\..\IDE\devenv.exe"
54) ELSE GOTO NOSDK9
55
4d760b54
LOK
56rem Skip to libCEC/x86 when we're running on win32
57if "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" goto libcecsharpx86
f00ff009 58
4d760b54
LOK
59rem Compile LibCecSharp (x64)
60echo. Cleaning LibCecSharp (x64)
f00ff009 61%COMPILER9% LibCecSharp.Net2.sln /clean "Release|x64"
4d760b54
LOK
62echo. Compiling LibCecSharp (x64)
63%COMPILER9% LibCecSharp.sln /build "Release|x64" /project LibCecSharp
64%COMPILER9% LibCecSharp.sln /build "Release|x64" /project CecSharpTester
65
66copy ..\build\LibCecSharp.dll ..\build\x64\LibCecSharp.dll
67copy ..\build\CecSharpTester.exe ..\build\x64\CecSharpTester.exe
68
69:libcecsharpx86
70rem Compile LibCecSharp (x86)
71echo. Cleaning LibCecSharp (x86)
72%COMPILER9% LibCecSharp.sln /clean "Release|x86"
73echo. Compiling LibCecSharp (x86)
74%COMPILER9% LibCecSharp.sln /build "Release|x86" /project LibCecSharp
75%COMPILER9% LibCecSharp.sln /build "Release|x86" /project CecSharpTester
09054f70 76
7879fa15 77:NOSDK9
4d760b54
LOK
78:CREATEINSTALLER
79echo. Copying driver installer
80copy "%DDK%\redist\DIFx\dpinst\MultiLin\amd64\dpinst.exe" ..\build\dpinst-amd64.exe
81copy "%DDK%\redist\DIFx\dpinst\MultiLin\x86\dpinst.exe" ..\build\dpinst-x86.exe
09054f70 82
4d760b54
LOK
83rem Clean things up before creating the installer
84del ..\build\LibCecSharp.pdb
85del ..\build\CecSharpTester.pdb
86copy ..\build\cec-client.x64.exe ..\build\x64\cec-client.x64.exe
87del ..\build\cec-client.x64.exe
88copy ..\build\libcec.x64.dll ..\build\x64\libcec.x64.dll
89del ..\build\libcec.x64.dll
90copy ..\build\libcec.x64.lib ..\build\x64\libcec.x64.lib
91del ..\build\libcec.x64.lib
92
93echo. Creating the installer
09054f70
LOK
94%NSIS% /V1 /X"SetCompressor /FINAL lzma" "libCEC.nsi"
95
4d760b54
LOK
96echo. The installer can be found here: ..\build\libCEC-installer.exe
97
98GOTO EXIT
7879fa15 99
4d760b54
LOK
100:NOSDK10
101echo. Both Visual Studio 2010 and Visual C++ Express 2010 were not found on your system.
7879fa15
LOK
102GOTO EXIT
103
104:NOSIS
4d760b54 105echo. NSIS could not be found on your system.
7879fa15
LOK
106GOTO EXIT
107
108:NODDK
4d760b54 109echo. Windows DDK could not be found on your system
7879fa15 110
f00ff009 111:EXIT