fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
d8a7a00
settings-overhaul
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 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 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 57echo %VERSION% > "%SOURCE_DIR% \version .txt " 58 59REM Get GIT branch 60FOR / F "tokens=* USEBACKQ" %%F IN (`git -C %SOURCE_DIR %rev -parse --abbrev -ref HEAD `)DO ( 61 SETBRANCH =%%F 62) 63 64SET PATH=% PATH %;%INNO_SETUP_DIR% ;%TOOLS_DIR% 65 66SETEXE_NAME =%NAME% -%BIT% .exe 67SETEXE_PATH =%BUILD_OUTPUT_DIR% \%EXE_NAME% 68 69SETZIP ="%RELEASES_DIR%\%VERSION%\%NAME%-%BIT%.love" 70REM SET ZIP=%BUILD_DIR%\%NAME%.love 71 72echo Zipping files in %SOURCE_DIR% into %ZIP% 73 74if exist %ZIP% del %ZIP% 75 76REM timeout /t 3 /nobreak 77 787 z a -tzip -mx =9 -xr !*.git -xr !*.dll %ZIP% "%SOURCE_DIR% \*" 79 80echo Copying LOVE2D binaries and license to %BUILD_OUTPUT_DIR% 81copy %LOVE_DIR% \license .txt %BUILD_OUTPUT_DIR% 82xcopy /d %LOVE_DIR% \*.dll %BUILD_OUTPUT_DIR% /y 83xcopy /d %SOURCE_DIR% \*.dll %BUILD_OUTPUT_DIR% /y 84 85echo Copying love .exe %BUILD_DIR% 86copy /b %LOVE_DIR% \love .exe +,,%BUILD_DIR% 87 88echo Customizing love . exe 89rcedit - x64 "%BUILD_DIR%\love.exe" --set- icon "%INSTALLER_DIR%\icon.ico" 90rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "FileDescription" "M 'Overlay " 91rcedit -x64 "%BUILD_DIR% \love .exe " --set- file - version "%VERSION%" 92rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "InternalName" "%NAME% -%BIT% " 93rcedit -x64 "%BUILD_DIR% \love .exe " --set- version - string "OriginalFilename" "%EXE_NAME% " 94 95REM We have to merge AFTER rcedit, since rcedit destroys the merged data 96echo Merging love .exe +%ZIP% into %EXE_PATH% 97copy / b "%BUILD_DIR%\love.exe" +%ZIP% %EXE_PATH% 98 99SETZIP ="%RELEASES_DIR%\%VERSION%\%NAME%-%BIT%-portable.zip" 100 101REM Remove old zip if it exists 102if exist %ZIP% del %ZIP% 103 104REM Create a release zip 1057 z a -tzip -mx =9 %ZIP% "%BUILD_OUTPUT_DIR% \*" 106 107if exist %INNO_SETUP_DIR% ( 108echo Building installer 109iscc release .iss 110move "%RELEASES_DIR%\m-overlay-x64-installer.exe" "%RELEASES_DIR% \%VERSION% " 111) 112 113:exit 114@PAUSE