@echo off

set JAVA_HOME=C:\Program Files\Java\jdk1.5.0
set IZPACK_DIR=C:\Program Files\IzPack


:build_tools
echo building ToolsProcessor...
"%JAVA_HOME%\bin\javac" -cp "%IZPACK_DIR%\lib\installer.jar";%CLASSPATH% -d .\tools -target 1.5 .\..\src\com\queplix\installer\ToolsProcessor.java
cd .\tools\
"%JAVA_HOME%\bin\jar" cvf queTools.jar .\com\queplix\installer\*.class
rd /S /Q .\com\
cd ..
echo ToolsProcessor was built

:build_uninstaller
echo copying Queweb Listeners
md "%IZPACK_DIR%\src\lib\QuewebUninstallerListener"
md "%IZPACK_DIR%\src\lib\QuewebInstallerListener"
copy .\..\src\com\queplix\installer\QuewebInstallerListener.java   "%IZPACK_DIR%\src\lib\QuewebInstallerListener"
copy .\..\src\com\queplix\installer\QuewebUninstallerListener.java "%IZPACK_DIR%\src\lib\QuewebUninstallerListener"

:build_langpack
echo copying Queplix langpack
copy .\IzPackCustomizing\que.xml "%IZPACK_DIR%\bin\langpacks\installer"
copy .\IzPackCustomizing\que.gif "%IZPACK_DIR%\bin\langpacks\flags"
copy .\IzPackCustomizing\que_light.xml "%IZPACK_DIR%\bin\langpacks\installer"
copy .\IzPackCustomizing\que_light.gif "%IZPACK_DIR%\bin\langpacks\flags"

:build_izpack
echo building custom panels...
copy /Y .\..\src\com\izforge\izpack\panels\*.java "%IZPACK_DIR%\src\lib\com\izforge\izpack\panels\"
copy /Y .\IzPackCustomizing\que-build.xml "%IZPACK_DIR%\src\"
cd %IZPACK_DIR%\src
ant -f que-build.xml queplix
echo QueWeb installer tools are configured

:exit