@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET ROOT=%cd%
REM Get the tools.zip from the innards of the installer
7z e *.exe .rsrc/1033/JAVA_CAB10/111
7z e 111 7z x tools.zip
REM Extract all
7z x -aoa tools.zip -ojdk
del tools.zip
del 111
REM Searching directory structure from root for subfolders and zipfiles.
FOR /F "delims==" %%d IN ('dir /ogne /ad /b /s "%ROOT%"') DO (
echo Descending into %%d
FOR /F "delims==" %%f IN ('dir /b "%%d\*.pack"') DO (
echo Extracting "%%d\%%f"
REM Extract all packs into jars.
jdk\bin\unpack200 -r "%%d\%%f" "%%d\%%~nf.jar"
)
)
ENDLOCAL
pause;