diff --git a/COMPILE_VMF.bat b/COMPILE_VMF.bat new file mode 100644 index 0000000..0c04c3b --- /dev/null +++ b/COMPILE_VMF.bat @@ -0,0 +1,72 @@ +@setlocal enableextensions +@echo off + +:: project-defined variable, you probably shouldn't change them + +set SOUCE_CODE_DIR=.\vmf_source +set TEMP_DIR=.\TEMP +set ORIGINAL_VMF_BUNDLE_FILE_NAME=98161451961848df +set NEW_VMF_BUNDLE_FILE_NAME=000_VMF_Main_Bundle + +:: default paths (in case this batch file won't be able to find steam installation folders) [you can change them :D] + +set MODS_DIR=C:\Program Files (x86)\Steam\steamapps\common\Warhammer End Times Vermintide\bundle\mods +set STINGRAY_EXE=C:\Program Files (x86)\Steam\steamapps\common\Warhammer End Times Vermintide Mod Tools\bin\stingray_win64_dev_x64.exe + +:: find Vermintide folder + +set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 235540" +set VALUE_NAME=InstallLocation + +for /F "usebackq skip=2 tokens=1-2*" %%A in (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) do ( + set MODS_DIR=%%C\bundle\mods +) + +:: find Stingray SDK folder + +set KEY_NAME="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 718610" +set VALUE_NAME=InstallLocation + +FOR /F "usebackq skip=2 tokens=1-2*" %%A in (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) do ( + + set STINGRAY_EXE=%%C\bin\stingray_win64_dev_x64.exe +) + +:: checking if Vermintide mods folder and Sringray binary exist + +if not exist "%MODS_DIR%" ( + @echo ERROR: Vermintide install location not found. Script execution aborted. + pause + exit +) + +if not exist "%STINGRAY_EXE%" ( + @echo ERROR: stingray_win64_dev_x64.exe not found. Script execution aborted. + pause + exit +) + +::compiling + +@echo Starting... + +"%STINGRAY_EXE%" --compile-for win32 --source-dir "%SOUCE_CODE_DIR%" --data-dir "%TEMP_DIR%\compile" --bundle-dir "%TEMP_DIR%\bundle" + +@echo Done. + +::moving compiled file to the mods directory (overwritting if needed) + +move /y %TEMP_DIR%\bundle\*. "%MODS_DIR%" + +::if ORIGINAL_VMF_BUNDLE_FILE_NAME and NEW_VMF_BUNDLE_FILE_NAME specified, delete the old renamed file and rename the new one + +if not "%ORIGINAL_VMF_BUNDLE_FILE_NAME%"== "" ^ +if not "%NEW_VMF_BUNDLE_FILE_NAME%"== "" ^ +if exist "%MODS_DIR%\%NEW_VMF_BUNDLE_FILE_NAME%" ^ +del "%MODS_DIR%\%NEW_VMF_BUNDLE_FILE_NAME%" + +if not "%ORIGINAL_VMF_BUNDLE_FILE_NAME%"== "" ^ +if not "%NEW_VMF_BUNDLE_FILE_NAME%"== "" ^ +ren "%MODS_DIR%\%ORIGINAL_VMF_BUNDLE_FILE_NAME%" "%NEW_VMF_BUNDLE_FILE_NAME%" + +pause \ No newline at end of file diff --git a/compile_mod.bat b/compile_mod.bat deleted file mode 100644 index 232ebaf..0000000 --- a/compile_mod.bat +++ /dev/null @@ -1,3 +0,0 @@ -"./bin/stingray_win64_dev_x64.exe" --compile-for win32 --source-dir vmf_source --data-dir TEMP/compile --bundle-dir TEMP/bundle -copy TEMP\bundle\*. "C:\Programs (x86)\Steam\steamapps\common\Warhammer End Times Vermintide\bundle\mods" -pause \ No newline at end of file