REM Batch file for rebuilding an existing war file, needed after updating the web component with the installer

SET ABS_WEBSERVERHOME=%1
SET WEBCOMPONENT=%2
SET ABS_DEPLOYHOME=%ABS_WEBSERVERHOME%deploy\%WEBCOMPONENT%

ECHO Remove %ABS_DEPLOYHOME%\%WEBCOMPONENT%.war
del /F /Q "%ABS_DEPLOYHOME%\%WEBCOMPONENT%.war" 1> nul 2>&1

ECHO Prepare %ABS_DEPLOYHOME%\%WEBCOMPONENT%.war
REM  Archive is created as zip first, this is needed to be able to clean up the archive using 7zip
%ABS_WEBSERVERHOME%tools\7-Zip\7z.exe a -tzip -r %ABS_DEPLOYHOME%\%WEBCOMPONENT%.zip %ABS_DEPLOYHOME%\*.*

ECHO Remove all accidentelly zipped war files from archive
%ABS_WEBSERVERHOME%tools\7-Zip\7z.exe d %ABS_DEPLOYHOME%\%WEBCOMPONENT%.zip *.war* 

REM  Rename created zip to war
rename %ABS_DEPLOYHOME%\%WEBCOMPONENT%.zip %WEBCOMPONENT%.war


