chiark / gitweb /
Adding a pre-build script for NSIS to ensure drivers have the correct size
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Wed, 24 Dec 2014 20:09:16 +0000 (12:09 -0800)
committerSteven Abadie <steven@alephobjects.com>
Tue, 30 Dec 2014 22:34:11 +0000 (15:34 -0700)
This is to avoid a LF/CRLF issue with git (depends on local settings) which causes the driver signature to fail.
Fixes issue #52

scripts/win32/check_drivers.bat [new file with mode: 0644]
scripts/win32/installer.nsi

diff --git a/scripts/win32/check_drivers.bat b/scripts/win32/check_drivers.bat
new file mode 100644 (file)
index 0000000..4aed3ff
--- /dev/null
@@ -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"
+)
index 06dd0c6eebefcbce665868e253c0088d162b2c53..2f11ad2444d5b294a63d1828793a01a969cfb215 100644 (file)
@@ -26,6 +26,8 @@ SetCompressor /SOLID lzma
 !include "MUI2.nsh"
 !include "Library.nsh"
 
+!system "check_drivers.bat"
+
 ;--------------------------------
 
 ; StrContains