2008-10-30 01:29:03 +01:00
|
|
|
@echo off
|
|
|
|
|
2012-02-21 16:24:11 +01:00
|
|
|
echo Setting default local path variables
|
2014-08-09 14:47:46 +02:00
|
|
|
set ahkpath=C:\Program Files (x86)\AutoHotkey
|
2020-06-11 13:07:02 +02:00
|
|
|
if not exist "%ahkpath%" set ahkpath=C:\Program Files\AutoHotkey
|
2008-11-03 12:39:41 +01:00
|
|
|
set Ahk2Exe=%ahkpath%\Compiler\Ahk2Exe.exe
|
|
|
|
|
2020-05-29 00:41:33 +02:00
|
|
|
set srcdir=..\src
|
|
|
|
set bindir=..\bin
|
2020-05-29 01:27:00 +02:00
|
|
|
set ahkrevoutput1=%srcdir%\_gitwcrev.generated.ahk
|
2008-11-03 12:39:41 +01:00
|
|
|
|
2020-05-29 01:27:00 +02:00
|
|
|
set NEO2AppData=%APPDATA%\Neo2
|
2008-11-26 21:32:13 +01:00
|
|
|
set customahk=%NEO2AppData%\custom.ahk
|
|
|
|
set customahkbuild=%customahk%.buildtmp
|
|
|
|
|
2020-05-29 01:27:00 +02:00
|
|
|
echo Generating version file
|
|
|
|
for /f "tokens=* USEBACKQ" %%R in (`"git rev-parse HEAD"`) do set Revision=%%R
|
|
|
|
set Revision=%Revision:~0,7%
|
2008-11-03 12:39:41 +01:00
|
|
|
|
2020-05-29 01:27:00 +02:00
|
|
|
echo Revision:="%Revision%" > "%ahkrevoutput1%"
|
2008-11-03 12:39:41 +01:00
|
|
|
|
2020-06-01 02:13:52 +02:00
|
|
|
if NOT EXIST %bindir% mkdir %bindir%
|
2020-05-29 00:41:33 +02:00
|
|
|
set fnexe=%bindir%\neo20.exe
|
2020-05-29 01:27:00 +02:00
|
|
|
git diff --exit-code > nul
|
|
|
|
if %ERRORLEVEL% EQU 1 (
|
2020-05-29 00:41:33 +02:00
|
|
|
set fnexe=%bindir%\neo20-r%Revision%.exe
|
2008-11-12 12:14:39 +01:00
|
|
|
)
|
2020-05-29 01:27:00 +02:00
|
|
|
REM Overwrite binary output name if given as parameter
|
|
|
|
if "%1:" NEQ ":" (
|
|
|
|
set fnexe=%1
|
|
|
|
)
|
2008-10-30 01:29:03 +01:00
|
|
|
|
2020-05-29 01:27:00 +02:00
|
|
|
echo Removing old version(s) of Neo AHK Exe file
|
2020-05-29 00:41:33 +02:00
|
|
|
del "%bindir%\neo20-r*.exe" 2> nul
|
2008-11-03 12:39:41 +01:00
|
|
|
|
2008-11-12 18:59:30 +01:00
|
|
|
set fnahk=%srcdir%\neo20-all.ahk
|
2008-11-03 14:54:12 +01:00
|
|
|
|
2008-11-26 21:32:13 +01:00
|
|
|
if exist "%customahk%" (
|
2009-07-09 18:28:05 +02:00
|
|
|
move "%customahk%" "%customahkbuild%"
|
2008-11-26 21:32:13 +01:00
|
|
|
)
|
|
|
|
|
2020-05-29 01:27:00 +02:00
|
|
|
echo Compiling the new driver using AutoHotkey
|
2021-01-22 01:06:22 +01:00
|
|
|
"%Ahk2Exe%" /in "%fnahk%" /out "%fnexe%" /icon "%srcdir%\neo_enabled.ico" /bin "%ahkpath%\Compiler\Unicode 32-bit.bin"
|
2008-10-30 01:29:03 +01:00
|
|
|
|
2008-11-26 21:32:13 +01:00
|
|
|
if exist "%customahkbuild%" (
|
2009-07-09 18:28:05 +02:00
|
|
|
move "%customahkbuild%" "%customahk%"
|
2008-11-26 21:32:13 +01:00
|
|
|
)
|
|
|
|
|
2020-05-29 01:27:00 +02:00
|
|
|
echo Driver update complete! You can now close this log window.
|
2008-11-06 04:13:57 +01:00
|
|
|
pause
|