fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
a8034e9
v2.1.6
1@echo OFF 2 3REM Release name 4SET NAME =m -overlay 5 6REM Architecture 7REM auto, x64, x86 8SET BIT =x64 9 10SETINNO_SETUP_DIR ="C:\Program Files (x86)\Inno Setup 6" 11 12SETLOVE_64_DIR ="C:\Program Files\LOVE" 13SETLOVE_32_DIR ="C:\Program Files (x86)\LOVE" 14 15IF "%BIT%" =="x64 " ( 16if exist %LOVE_64_DIR% SETLOVE_DIR =%LOVE_64_DIR% 17) 18IF "%BIT%" =="x86 " ( 19if exist %LOVE_32_DIR% SETLOVE_DIR =%LOVE_32_DIR% 20) 21 22if not exist %LOVE_DIR% goto :exit 23 24where /q 7 z ||ECHO Could not find 7 Zip ,please download and install : https://www .7 -zip .org /download .html and add it to PATH &&goto :exit 25 26SET INSTALLER_DIR =.\installer 27SET BUILD_DIR =.\build 28SETBUILD_OUTPUT_DIR =%BUILD_DIR% \%BIT% 29SET SOURCE_DIR =.\source 30SET LAUNCHER_DIR =.\launcher 31SET RELEASES_DIR =.\releases 32SETTOOLS_DIR =.\tools 33 34ifnot exist %BUILD_DIR% mkdir %BUILD_DIR% 35if not exist %BUILD_OUTPUT_DIR% mkdir %BUILD_OUTPUT_DIR% 36 37SET BRANCH =dirty 38SETCOMMIT =1 39SET VERSION = v0 . 0 .0 40 41REM Get GIT commit number 42FOR / F "tokens=* USEBACKQ" %%F IN (`git -C %SOURCE_DIR %rev -list --count --first -parent HEAD `)DO ( 43SET COMMIT =%%F 44) 45 46REM Get latest tag 47FOR / F "tokens=* USEBACKQ" %%F IN (`git -C %SOURCE_DIR %describe --tags `)DO ( 48echo %%F 49 SETVERSION =%%F 50) 51 52IF"%VERSION:~0,1%" =="v " ( 53echo Stripping 'v 'from VERSION 54 SETVERSION =%VERSION :~1 % 55) 56 57if not exist %RELEASES_DIR% \%VERSION% mkdir %RELEASES_DIR% \%VERSION% 58 59echo %VERSION% >%SOURCE_DIR% \version .txt 60 61REM Get GIT branch 62FOR / F "tokens=* USEBACKQ" %%F IN (`git -C %SOURCE_DIR %rev -parse --abbrev -ref HEAD `)DO ( 63 SETBRANCH =%%F 64) 65 66SET PATH=% PATH %;%INNO_SETUP_DIR% ;%TOOLS_DIR% 67 68SETEXE_NAME =%NAME% -%BIT% .exe 69SETEXE_PATH =%BUILD_OUTPUT_DIR% \%EXE_NAME% 70 71SETAPPLICATION_LOVE =%BUILD_DIR% \application .love 72SETLAUNCHER_LOVE =%BUILD_DIR% \%NAME% -%BIT% -installer .love 73 74echo Zipping files in %SOURCE_DIR% into %APPLICATION_LOVE% 75 76if exist %APPLICATION_LOVE% del %APPLICATION_LOVE% 77 78REM timeout /t 3 /nobreak 79 807 z a -tzip -mx =9 -xr !*.git -xr !*.dll %APPLICATION_LOVE% "%SOURCE_DIR% \*" 817 z a -tzip -mx =9 -xr !*.git -xr !*.dll %LAUNCHER_LOVE% "%LAUNCHER_DIR% \*" 82 83copy %APPLICATION_LOVE% %RELEASES_DIR% \%VERSION% /y 84copy %LAUNCHER_LOVE% %RELEASES_DIR% \%VERSION% /y 85 86echo Copying LOVE2D binaries and license to %BUILD_OUTPUT_DIR% 87copy %LOVE_DIR% \license .txt %BUILD_OUTPUT_DIR% 88xcopy /d %LOVE_DIR% \*.dll %BUILD_OUTPUT_DIR% /y 89xcopy /d %SOURCE_DIR% \*.dll %BUILD_OUTPUT_DIR% /y 90del %BUILD_OUTPUT_DIR% \sqlite3 .dll 91 92echo Copying love .exe %BUILD_DIR% 93copy /b %LOVE_DIR% \love .exe +,,%BUILD_DIR% 94 95echo Customizing love . exe 96rcedit - x64 "%BUILD_DIR%\love.exe" --set- icon "%INSTALLER_DIR%\icon.ico" 97rcedit -x64 "%BUILD_DIR% \love .exe " --set- file - version "%VERSION%" 98rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "FileDescription" "M 'Overlay " 99rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "InternalName" "%NAME% -%BIT% " 100rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "OriginalFilename" "%EXE_NAME% " 101 102REM We have to merge AFTER rcedit, since rcedit destroys the merged data 103echo Merging love .exe +%LAUNCHER_LOVE% into %EXE_PATH% 104copy / b "%BUILD_DIR%\love.exe" +%LAUNCHER_LOVE% %EXE_PATH% 105REM copy /b "%BUILD_DIR%\love.exe"+%APPLICATION_LOVE% %EXE_PATH% 106 107SETPORTABLE_ZIP ="%RELEASES_DIR%\%VERSION%\%NAME%-%BIT%-portable.zip" 108 109REM Remove old zip if it exists 110if exist %PORTABLE_ZIP% del %PORTABLE_ZIP% 111 112REM Create a release zip 1137 z a -tzip -mx =9 %PORTABLE_ZIP% "%BUILD_OUTPUT_DIR% \*" 114 115if exist %INNO_SETUP_DIR% ( 116echo Building installer 117iscc release .iss 118move "%RELEASES_DIR%\m-overlay-x64-installer.exe" "%RELEASES_DIR% \%VERSION% " 119) 120 121:exit 122@PAUSE