cec: let create-installer.cmd sign all binaries on the production build system.
[deb_libcec.git] / support / create-installer.cmd
index cd5227c564488eb7c65d43130ce1bfb4d1705807..6a6648679799c7fa75b57cf2470a3a9417613618 100644 (file)
@@ -77,7 +77,6 @@ echo. Compiling LibCecSharp (x86)
 %COMPILER9% LibCecSharp.sln /build "Release|x86" /project CecSharpTester
 
 :NOSDK9
-:CREATEINSTALLER
 echo. Copying driver installer
 copy "%DDK%\redist\DIFx\dpinst\MultiLin\amd64\dpinst.exe" ..\build\dpinst-amd64.exe
 copy "%DDK%\redist\DIFx\dpinst\MultiLin\x86\dpinst.exe" ..\build\dpinst-x86.exe
@@ -92,9 +91,31 @@ del ..\build\libcec.x64.dll
 copy ..\build\libcec.x64.lib ..\build\x64\libcec.x64.lib
 del ..\build\libcec.x64.lib
 
+rem Check for sign-binary.cmd, only present on the Pulse-Eight production build system
+rem Calls signtool.exe and signs the DLLs with Pulse-Eight's code signing key
+IF NOT EXIST "..\support\sign-binary.cmd" GOTO CREATEINSTALLER
+echo. Signing all binaries
+CALL ..\support\sign-binary.cmd ..\build\cec-client.exe
+CALL ..\support\sign-binary.cmd ..\build\CecSharpTester.exe
+CALL ..\support\sign-binary.cmd ..\build\libcec.dll
+CALL ..\support\sign-binary.cmd ..\build\LibCecSharp.dll
+CALL ..\support\sign-binary.cmd ..\build\x64\cec-client.x64.exe
+CALL ..\support\sign-binary.cmd ..\build\x64\CecSharpTester.exe
+CALL ..\support\sign-binary.cmd ..\build\x64\libcec.x64.dll
+CALL ..\support\sign-binary.cmd ..\build\x64\LibCecSharp.dll
+
+:CREATEINSTALLER
 echo. Creating the installer
 %NSIS% /V1 /X"SetCompressor /FINAL lzma" "libCEC.nsi"
 
+IF NOT EXIST "..\build\libCEC-installer.exe" GOTO :ERRORCREATINGINSTALLER
+
+rem Sign the installer if sign-binary.cmd exists
+IF EXIST "..\support\sign-binary.cmd" (
+  echo. Signing the installer binaries
+  CALL ..\support\sign-binary.cmd ..\build\libCEC-installer.exe
+)
+
 echo. The installer can be found here: ..\build\libCEC-installer.exe
 
 GOTO EXIT
@@ -109,5 +130,10 @@ GOTO EXIT
 
 :NODDK
 echo. Windows DDK could not be found on your system
+GOTO EXIT
+
+:ERRORCREATINGINSTALLER
+echo. The installer could not be created. The most likely cause is that something went wrong while compiling.
 
 :EXIT
+cd ..\support
\ No newline at end of file