diff --git a/bin/pack/pack.bat b/bin/pack/pack.bat deleted file mode 100644 index 856181ab..00000000 --- a/bin/pack/pack.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo off - -setlocal enabledelayedexpansion -FOR /d %%i IN ("*") DO ( - echo Packing %%i - rem "C:\Program Files\7-Zip\7z.exe" a "%%i.zip" ".\%%i\*" -m0=BZip2 - rem "C:\Program Files\7-Zip-Zstandard\7za.exe" a "%%i.zip" ".\%%i\*" -m0=Zstd - rem "C:\Program Files\7-Zip\7z.exe" a "%%i.zip" ".\%%i\*" -m0=Copy - "C:\Program Files\7-Zip\7z.exe" a "%%i.zip" ".\%%i\*" - if !errorlevel! neq 0 exit /b !errorlevel! - - cls -) - -pause \ No newline at end of file diff --git a/build.bat b/build.bat index d1f1c43b..65e372d3 100644 --- a/build.bat +++ b/build.bat @@ -6,7 +6,7 @@ ECHO Only use on a clean project directory. ECHO ====================================================== rem SET M2_MSVC_DIR=C:\Program Files\Microsoft Visual Studio\2022\Community\ -rem SET M2_PML_PATH=C:\Users\User\Path\To\PackMakerLite\PackMakerLite.exe +rem SET M2_7ZIP_PATH=C:\Program Files\7-Zip\7z.exe rem Check the environment variables VERIFY OTHER 2>nul @@ -16,17 +16,21 @@ IF NOT DEFINED M2_MSVC_DIR ( ECHO M2_MSVC_DIR is NOT defined! Please define M2_MSVC_DIR with the path of your local MSVC install. EXIT /B -1 ) -IF NOT DEFINED M2_PML_PATH ( - ECHO M2_PML_PATH is NOT defined! Please define M2_PML_PATH with the path of your local PackMakerLite executable. +IF NOT DEFINED M2_7ZIP_PATH ( + ECHO M2_7ZIP_PATH is NOT defined! Please define M2_7ZIP_PATH with the path of your local 7-Zip "7z.exe" executable. EXIT /B -1 ) ENDLOCAL +rem Cause variables to be expanded at execution time (in order for !errorlevel! to work) +SETLOCAL EnableDelayedExpansion + rem Initialize the MSVC environment CALL "%M2_MSVC_DIR%\VC\Auxiliary\Build\vcvars32.bat" rem Build msbuild Metin2Client.sln /p:Configuration=Distribute /p:Platform="Win32" +if !errorlevel! neq 0 exit /b !errorlevel! rem Start assembling the client package RMDIR /S /Q dist @@ -48,12 +52,11 @@ MKDIR dist\screenshot\ xcopy bin\upload\ dist\upload\ /E /Y /Q rem Build and copy the archives -DEL /F /Q "bin\pack\*.eix" -DEL /F /Q "bin\pack\*.epk" +DEL /F /Q "bin\pack\*.zip" FOR /d %%i IN ("bin\pack\*") DO ( echo Packing %%i - %M2_PML_PATH% --nolog --parallel -p "%%i" + "%M2_7ZIP_PATH%" a "%%i.zip" ".\%%i\*" + if !errorlevel! neq 0 exit /b !errorlevel! ) -MOVE /Y bin\pack\*.eix dist\pack\ -MOVE /Y bin\pack\*.epk dist\pack\ +MOVE /Y bin\pack\*.zip dist\pack\