@echo off
rem Copyright by krzysiu.net, 2017
rem Licensed as MIT (full text: https://opensource.org/licenses/MIT)

setlocal
set binImg1=Unicode 64-bit
set binImg2=Unicode 32-bit
set binImg3=ANSI 32-bit

REM SET YOUR PATH TO COMPILER HERE
cd /d "C:\Program Files\AutoHotkey\Compiler"

echo Please choose binary base:
echo 1) Unicode 64 bit (default in 5 seconds)
echo 2) Unicode 32 bit
echo 3) ANSI 32 bit
echo.
choice /c 123 /t 5 /d 1 /m "Your choice:"
if "%ERRORLEVEL%" == "1" set binImg=%binImg1%
if "%ERRORLEVEL%" == "2" set binImg=%binImg2%
if "%ERRORLEVEL%" == "3" set binImg=%binImg3%
echo.

choice /c yn /t 5 /d n /m "Do you want to compress file using MPRESS? Default in 5 sec.: no."
if "%ERRORLEVEL%" == "1" set doComp=1
if "%ERRORLEVEL%" == "2" set doComp=0

if exist "%~dpn1.ico" set iconParam=/icon "%~dpn1.ico"
echo.

echo Compiling...
ahk2exe /in %1 /out "%~dpn1.exe" %iconParam% /bin "%binImg%.bin" /mpress %doComp%endlocal