fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
29736a3
gui
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 &&goto :exit 25 26SET INSTALLER_DIR =.\installer 27SET BUILD_DIR =.\build 28SETBUILD_OUTPUT_DIR =%BUILD_DIR% \%BIT% 29SET SOURCE_DIR =.\source 30SET RELEASES_DIR =.\releases 31SETTOOLS_DIR =.\tools 32 33ifnot exist %BUILD_DIR% mkdir %BUILD_DIR% 34if not exist %RELEASES_DIR% mkdir %RELEASES_DIR% 35if not exist %BUILD_OUTPUT_DIR% mkdir %BUILD_OUTPUT_DIR% 36 37SETBRANCH =dirty 38SER VERSION =1 39 40REM Get GIT commit number 41FOR / F "tokens=* USEBACKQ" %%F IN (`git -C %SOURCE_DIR %rev -list --count --first -parent HEAD `)DO ( 42SET VERSION =%%F 43) 44 45REM Get GIT branch 46FOR / F "tokens=* USEBACKQ" %%F IN (`git -C %SOURCE_DIR %rev -parse --abbrev -ref HEAD `)DO ( 47 SETBRANCH =%%F 48) 49 50SET PATH=% PATH %;%INNO_SETUP_DIR% ;%TOOLS_DIR% 51 52SETEXE_NAME =%NAME% -%BIT% .exe 53SETEXE_PATH =%BUILD_OUTPUT_DIR% \%EXE_NAME% 54 55SETZIP =%BUILD_DIR% \%NAME% .love 56 57echo Zipping files in %SOURCE_DIR% into %ZIP% 58 59if exist %ZIP% del %ZIP% 607 z a -tzip -mx =9 -xr !*.git -xr !*.dll %ZIP% "%SOURCE_DIR% \*" 61 62echo Copying LOVE2D binaries and license to %BUILD_OUTPUT_DIR% 63copy %LOVE_DIR% \license .txt %BUILD_OUTPUT_DIR% 64xcopy /d %LOVE_DIR% \*.dll %BUILD_OUTPUT_DIR% /y 65xcopy /d %SOURCE_DIR% \*.dll %BUILD_OUTPUT_DIR% /y 66 67echo Copying love .exe %BUILD_DIR% 68copy /b %LOVE_DIR% \love .exe +,,%BUILD_DIR% 69 70echo Customizing love . exe 71rcedit - x64 "%BUILD_DIR%\love.exe" --set- icon "%INSTALLER_DIR%\icon.ico" 72rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "FileDescription" "M 'Overlay " 73rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "FileVersion" "%VERSION% " 74rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "InternalName" "%NAME% -%BIT% " 75rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "OriginalFilename" "%EXE_NAME% " 76 77REM We have to merge AFTER rcedit, since rcedit destroys the merged data 78echo Merging love .exe +%ZIP% into %EXE_PATH% 79copy / b "%BUILD_DIR%\love.exe" +%ZIP% %EXE_PATH% 80 81SETZIP ="%RELEASES_DIR%\%NAME%-%BIT% (%BRANCH%-%VERSION%).zip" 82 83REM Remove old zip if it exists 84if exist %ZIP% del %ZIP% 85 86REM Create a release zip 877 z a -tzip -mx =9 %ZIP% "%BUILD_OUTPUT_DIR% \*" 88 89if exist %INNO_SETUP_DIR% ( 90echo Building installer 91iscc release .iss 92) 93 94:exit 95@PAUSE