From: Youness Alaoui Date: Wed, 24 Dec 2014 20:09:16 +0000 (-0800) Subject: Adding a pre-build script for NSIS to ensure drivers have the correct size X-Git-Tag: 14.09-1.18~14 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1822641ad054b286b0fde1e3bd87e12d048a9cbb;p=cura.git Adding a pre-build script for NSIS to ensure drivers have the correct size This is to avoid a LF/CRLF issue with git (depends on local settings) which causes the driver signature to fail. Fixes issue #52 --- diff --git a/scripts/win32/check_drivers.bat b/scripts/win32/check_drivers.bat new file mode 100644 index 00000000..4aed3ff3 --- /dev/null +++ b/scripts/win32/check_drivers.bat @@ -0,0 +1,17 @@ +@echo off +setlocal +set rambo="drivers/rambo.inf" +set arduino="drivers/arduino.inf" + +FOR /F "usebackq" %%A IN ('%rambo%') DO set rambosize=%%~zA +FOR /F "usebackq" %%A IN ('%arduino%') DO set arduinosize=%%~zA +if not "%rambosize%" == "1257" ( + echo RAMBo driver file size is wrong. This could be caused by your local git settings changing the LF line into into CRLF. + echo Make sure you use the correct INF files + taskkill.exe /F /IM "makensis.exe" +) +if not "%arduinosize%" == "6460" ( + echo Arduino driver file size is wrong. This could be caused by your local git settings changing the CRLF line into into LF. + echo Make sure you use the correct INF files + taskkill.exe /F /IM "makensis.exe" +) diff --git a/scripts/win32/installer.nsi b/scripts/win32/installer.nsi index 06dd0c6e..2f11ad24 100644 --- a/scripts/win32/installer.nsi +++ b/scripts/win32/installer.nsi @@ -26,6 +26,8 @@ SetCompressor /SOLID lzma !include "MUI2.nsh" !include "Library.nsh" +!system "check_drivers.bat" + ;-------------------------------- ; StrContains