Jump to content

Java Multi Maker


mooms

Recommended Posts

Be aware (from 5eraph http://www.ryanvm.net/forum/viewtopic.php?p=136570#136570) :

 

This is what I can find about JRE8 on XP:

Cheers and Regards

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

If you add the -ai switch the SFX is ran silently.

If you want it silent when double clicked or ran without any switches, you have to modify the script.

You have to understand the syntax of a 7zip SFX. There is many topics explaining it here, or see the help file.

Link to comment
Share on other sites

I download the x86 & x64 package (jre-7u60-windows-i586 & jre-7u60-windows-x64). when i run the program i have error ''this installation package could not be opened. verify that the package exists...''

Link to comment
Share on other sites

Do you have followed the instructions on the first post ?

 

How to use:

 

- Extract the archive in a work folder with no space in the path.

- Download the x86 and/or x64 Offline setup of Java 6/7/8 and put it in the same folder.

- Run the batch file.

Also check that the installers are not corrupted.

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

Here was my solution.

 

I first noticed with 8u20 that the 64bit version when extracted had different file names so the rename commands failed.

ren "%~dp0JRE_TEMP64\%JAVAFN64%_101_JAVA_INSTALLER.bin" jre64_inst.msi
ren "%~dp0JRE_TEMP64\%JAVAFN64%_102_JAVA_INSTALLER.bin" Data1.cab

 

needed to be changed to

ren "%~dp0JRE_TEMP64\%JAVAFN64%_105_JAVA_INSTALLER.bin" jre64_inst.msi
ren "%~dp0JRE_TEMP64\%JAVAFN64%_103_JAVA_INSTALLER.bin" Data1.cab

 

Then with 8u25, the files did not extract correctly, so I changed the script (see below) to launch the exe(s) and then grab the msi from the profile temp and then kill the exe(s).  It seems to work nicely so far.

 

The lines in bold are where the changes can be found.

 

@echo off
setlocal enableextensions
if not exist "%~dp0bin\7za.exe" goto :No7za
if not exist "%~dp0bin\JavaInst.sfx" goto :No7SFX
if not exist "%~dp0bin\ResourcesExtract.exe" goto :NoResExtr
SET SZ="%~dp0bin\7za.exe"
if exist "%~dp0jre-*-windows-i586.exe" GOTO :X86
if not exist "%~dp0jre-*-windows-i586.exe" GOTO :X64
 
 
 
:X86
if exist "%~dp0jre-*-windows-x64.exe" GOTO :DUAL
set JAVAFILE=
for %%j in (%~dp0jre-*-windows-i586.exe) do call :GETJAVAVER %%~nxj
if "%JAVAFILE%"=="" goto :NoJavaInst
for /f "delims=- tokens=2" %%j in ("%JAVAFILE%") do set JAVAVER=%%j
SET MAJ=%JAVAVER:~0,1%
SET MIN=%JAVAVER:~2,3%
if exist "%~dp0JRE_TEMP" rmdir /s /q "%~dp0JRE_TEMP"
mkdir "%~dp0JRE_TEMP"
::start /w "Unpacking JRE..." "%~dp0bin\ResourcesExtract.exe" /Source "%~dp0%JAVAFILE%" /DestFolder "%~dp0JRE_TEMP" /ExtractIcons 0 /ExtractCursors 0 /ExtractBitmaps 0 /ExtractHTML 0 /ExtractManifests 0 /ExtractAnimatedIcons 0 /ExtractAnimatedCursors 0 /ExtractAVI 0 /ExtractTypeLib 0 /ExtractBinary 1 /ScanSubFolders 0 /FileExistMode 1 /OpenDestFolder 0
::ren "%~dp0JRE_TEMP\%JAVAFN%_101_JAVA_INSTALLER.bin" jre_inst.msi
::ren "%~dp0JRE_TEMP\%JAVAFN%_102_JAVA_INSTALLER.bin" Data1.cab
::del /f /q "%~dp0JRE_TEMP\%JAVAFN%*"
 
ECHO.
ECHO Launching JRE 32bit to grab msi . . .
start "Launching JRE 32bit to grab msi . . ." "%~dp0%JAVAFILE%"
if exist "%~dp0JRE_ADMAIO" rmdir /s /q "%~dp0JRE_ADMAIO"
mkdir "%~dp0JRE_ADMAIO"
:DUAL32BITLOOP
IF NOT EXIST "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%\jre1.%MAJ%.0_%MIN%.msi" GOTO :DUAL32BITLOOP
ping -n 10 127.0.0.1>nul
copy "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%\jre1.%MAJ%.0_%MIN%.msi" "%~dp0JRE_TEMP\jre_inst.msi"
ping -n 2 127.0.0.1>nul
TASKKILL /F /IM %JAVAFILE%

 
start /w "Creating administrative installation point..." msiexec /a "%~dp0JRE_TEMP\jre_inst.msi" /qb! TARGETDIR="%~dp0JRE_ADM"
rmdir /s /q "%~dp0JRE_TEMP"
%SZ% a "%~dp0JavaInst.7z" "%~dp0JRE_ADM\*" -mx=9 -mmt=off -m0=BCJ2 -m1=LZMA:d27:fb=128:mc=256 -m2=LZMA:d24:fb=128:mc=256 -m3=LZMA:d24:fb=128:mc=256 -mb0:1 -mb0s1:2 -mb0s2:3 -r
call :CONFIG
copy /b /y "%~dp0bin\JavaInst.sfx"+"%~dp032.cfg"+"%~dp0JavaInst.7z" "%~dp0Java%JAVAVER%.exe"
rmdir /s /q "%~dp0JRE_ADM"
del /f /q "%~dp0JavaInst.7z"
mkdir "%~dp0svcpack"
copy /b /y "%~dp0Java%JAVAVER%.exe" "%~dp0svcpack\Java%JAVAVER%.exe"
call :ENTRIES_INI
%SZ% a "%~dp0Java_Runtime_%MAJ%_update_%MIN%_AddOn.zip" "%~dp0ENTRIES_Java.ini" "%~dp0svcpack"
del /f /q "%~dp032.cfg"
del /f /q "%~dp0ENTRIES_Java.ini"
rmdir /s /q "%~dp0svcpack"
exit /b
 
 
:X64
set JAVAFILE64=
for %%k in (%~dp0jre-*-windows-x64.exe) do call :GETJAVAVER64 %%~nxk
if "%JAVAFILE64%"=="" goto :NoJavaInst
if not exist "%~dp0bin\ResourcesExtract.exe" goto :NoResExtr
for /f "delims=- tokens=2" %%k in ("%JAVAFILE64%") do set JAVAVER64=%%k
SET MAJ=%JAVAVER64:~0,1%
SET MIN=%JAVAVER64:~2,3%
echo JRE newest version found^: 1.%JAVAVER64%
echo Java file name only - %JAVAFN64%
if exist "%~dp0JRE_TEMP64" rmdir /s /q "%~dp0JRE_TEMP64"
mkdir "%~dp0JRE_TEMP64"
::start /w "Unpacking JRE..." "%~dp0bin\ResourcesExtract.exe" /Source "%~dp0%JAVAFILE64%" /DestFolder "%~dp0JRE_TEMP64" /ExtractIcons 0 /ExtractCursors 0 /ExtractBitmaps 0 /ExtractHTML 0 /ExtractManifests 0 /ExtractAnimatedIcons 0 /ExtractAnimatedCursors 0 /ExtractAVI 0 /ExtractTypeLib 0 /ExtractBinary 1 /ScanSubFolders 0 /FileExistMode 1 /OpenDestFolder 0
::ren "%~dp0JRE_TEMP64\%JAVAFN64%_105_JAVA_INSTALLER.bin" jre64_inst.msi
::ren "%~dp0JRE_TEMP64\%JAVAFN64%_103_JAVA_INSTALLER.bin" Data1.cab
::del /f /q "%~dp0JRE_TEMP64\%JAVAFN64%*"
 
ECHO.
ECHO Launching JRE 64bit to grab msi . . .
start "Launching JRE 64bit to grab msi . . ." "%~dp0%JAVAFILE64%"
:DUAL64BITLOOP
IF NOT EXIST "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%_x64\jre1.%MAJ%.0_%MIN%.msi" GOTO :DUAL64BITLOOP
ping -n 10 127.0.0.1>nul
copy "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%_x64\jre1.%MAJ%.0_%MIN%.msi" "%~dp0JRE_TEMP64\jre64_inst.msi"
ping -n 2 127.0.0.1>nul

TASKKILL /F /IM %JAVAFILE64%
 
if exist "%~dp0JRE_ADM64" rmdir /s /q "%~dp0JRE_ADM64"
mkdir "%~dp0JRE_ADM64"
start /w "Creating administrative installation point..." msiexec /a "%~dp0JRE_TEMP64\jre64_inst.msi" /qb! TARGETDIR="%~dp0JRE_ADM64"
rmdir /s /q "%~dp0JRE_TEMP64"
%SZ% a "%~dp0JavaInst-x64.7z" "%~dp0JRE_ADM64\*" -mx=9 -mmt=off -m0=BCJ2 -m1=LZMA:d27:fb=128:mc=256 -m2=LZMA:d24:fb=128:mc=256 -m3=LZMA:d24:fb=128:mc=256 -mb0:1 -mb0s1:2 -mb0s2:3 -r
call :CONFIG_64
copy /b /y "%~dp0bin\JavaInst.sfx"+"%~dp064.cfg"+"%~dp0JavaInst-x64.7z" "%~dp0Java%JAVAVER64%-x64.exe"
rmdir /s /q "%~dp0JRE_ADM64"
del /f /q "%~dp0JavaInst-x64.7z"
del /f /q "%~dp064.cfg"
mkdir "%~dp0svcpack"
copy /b /y "%~dp0Java%JAVAVER64%-x64.exe" "%~dp0svcpack\Java%JAVAVER64%.exe"
call :ENTRIES_INI_64
%SZ% a "%~dp0Java_Runtime_%MAJ%_update_%MIN%_x64_AddOn.zip" "%~dp0ENTRIES_Java.ini" "%~dp0svcpack"
del /f /q "%~dp0ENTRIES_Java.ini"
rmdir /s /q "%~dp0svcpack"
exit /b
 
 
 
:DUAL
set JAVAFILE=
for %%j in (%~dp0jre-*-windows-i586.exe) do call :GETJAVAVER %%~nxj
if "%JAVAFILE%"=="" goto :NoJavaInst
for /f "delims=- tokens=2" %%j in ("%JAVAFILE%") do set JAVAVER=%%j
SET MAJ=%JAVAVER:~0,1%
SET MIN=%JAVAVER:~2,3%
echo JRE newest version found^: 1.%JAVAVER%
echo Java file name only - %JAVAFN%
if exist "%~dp0JRE_TEMP" rmdir /s /q "%~dp0JRE_TEMP"
mkdir "%~dp0JRE_TEMP"
::start /w "Unpacking JRE..." "%~dp0bin\ResourcesExtract.exe" /Source "%~dp0%JAVAFILE%" /DestFolder "%~dp0JRE_TEMP" /ExtractIcons 0 /ExtractCursors 0 /ExtractBitmaps 0 /ExtractHTML 0 /ExtractManifests 0 /ExtractAnimatedIcons 0 /ExtractAnimatedCursors 0 /ExtractAVI 0 /ExtractTypeLib 0 /ExtractBinary 1 /ScanSubFolders 0 /FileExistMode 1 /OpenDestFolder 0
::ren "%~dp0JRE_TEMP\%JAVAFN%_101_JAVA_INSTALLER.bin" jre_inst.msi
::ren "%~dp0JRE_TEMP\%JAVAFN%_102_JAVA_INSTALLER.bin" Data1.cab
::del /f /q "%~dp0JRE_TEMP\%JAVAFN%*"
 
ECHO.
ECHO Launching JRE 32bit to grab msi . . .
start "Launching JRE 32bit to grab msi . . ." "%~dp0%JAVAFILE%"
if exist "%~dp0JRE_ADMAIO" rmdir /s /q "%~dp0JRE_ADMAIO"
mkdir "%~dp0JRE_ADMAIO"
:DUAL32BITLOOP
IF NOT EXIST "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%\jre1.%MAJ%.0_%MIN%.msi" GOTO :DUAL32BITLOOP
ping -n 10 127.0.0.1>nul
copy "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%\jre1.%MAJ%.0_%MIN%.msi" "%~dp0JRE_TEMP\jre_inst.msi"
ping -n 2 127.0.0.1>nul
TASKKILL /F /IM %JAVAFILE%

 
start /w "Creating administrative installation point..." msiexec /a "%~dp0JRE_TEMP\jre_inst.msi" /qb! TARGETDIR="%~dp0JRE_ADMAIO"
rmdir /s /q "%~dp0JRE_TEMP"
 
ECHO.
 
set JAVAFILE64=
for %%k in (%~dp0jre-*-windows-x64.exe) do call :GETJAVAVER64 %%~nxk
if "%JAVAFILE64%"=="" goto :NoJavaInst
for /f "delims=- tokens=2" %%k in ("%JAVAFILE64%") do set JAVAVER64=%%k
echo JRE newest version found^: 1.%JAVAVER64%
echo Java file name only - %JAVAFN64%
if exist "%~dp0JRE_TEMP64" rmdir /s /q "%~dp0JRE_TEMP64"
mkdir "%~dp0JRE_TEMP64"
::start /w "Unpacking JRE..." "%~dp0bin\ResourcesExtract.exe" /Source "%~dp0%JAVAFILE64%" /DestFolder "%~dp0JRE_TEMP64" /ExtractIcons 0 /ExtractCursors 0 /ExtractBitmaps 0 /ExtractHTML 0 /ExtractManifests 0 /ExtractAnimatedIcons 0 /ExtractAnimatedCursors 0 /ExtractAVI 0 /ExtractTypeLib 0 /ExtractBinary 1 /ScanSubFolders 0 /FileExistMode 1 /OpenDestFolder 0
::ren "%~dp0JRE_TEMP64\%JAVAFN64%_105_JAVA_INSTALLER.bin" jre64_inst.msi
::ren "%~dp0JRE_TEMP64\%JAVAFN64%_103_JAVA_INSTALLER.bin" Data1.cab
 
ECHO.
ECHO Launching JRE 64bit to grab msi . . .
start "Launching JRE 64bit to grab msi . . ." "%~dp0%JAVAFILE64%"
:DUAL64BITLOOP
IF NOT EXIST "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%_x64\jre1.%MAJ%.0_%MIN%.msi" GOTO :DUAL64BITLOOP
ping -n 10 127.0.0.1>nul
copy "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%_x64\jre1.%MAJ%.0_%MIN%.msi" "%~dp0JRE_TEMP64\jre64_inst.msi"
ping -n 2 127.0.0.1>nul
TASKKILL /F /IM %JAVAFILE64%

 
start /w "Creating administrative installation point..." msiexec /a "%~dp0JRE_TEMP64\jre64_inst.msi" /qb! TARGETDIR="%~dp0JRE_ADMAIO"
rmdir /s /q "%~dp0JRE_TEMP64"
%SZ% a "%~dp0JavaInst-AIO.7z" "%~dp0JRE_ADMAIO\*" -mx=9 -mmt=off -m0=BCJ2 -m1=LZMA:d27:fb=128:mc=256 -m2=LZMA:d24:fb=128:mc=256 -m3=LZMA:d24:fb=128:mc=256 -mb0:1 -mb0s1:2 -mb0s2:3 -r
call :CONFIG_AIO
copy /b /y "%~dp0bin\JavaInst.sfx"+"%~dp0AIO.cfg"+"%~dp0JavaInst-AIO.7z" "%~dp0Java%JAVAVER64%-Dual.exe"
rmdir /s /q "%~dp0JRE_ADMAIO"
del /f /q "%~dp0JavaInst-AIO.7z"
del /f /q "%~dp0AIO.cfg"
mkdir "%~dp0svcpack"
copy /b /y "%~dp0Java%JAVAVER64%-Dual.exe" "%~dp0svcpack\Java%JAVAVER64%.exe"
call :ENTRIES_INI_AIO
%SZ% a "%~dp0Java_Runtime_%MAJ%_update_%MIN%_Dual_AddOn.zip" "%~dp0ENTRIES_Java.ini" "%~dp0svcpack"
del /f /q "%~dp0ENTRIES_Java.ini"
rmdir /s /q "%~dp0svcpack"
exit /b
 
 
 
:CONFIG
ECHO ;!@Install@!UTF-8!> "%~dp032.cfg"
ECHO SetEnvironment="swUninst_x64=HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp032.cfg"
ECHO SetEnvironment="swUninst_x86=HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp032.cfg"
ECHO SetEnvironment="DelOldVer=%%%%P:hidcon:cmd /c For /F \"tokens=2 delims={}\" %%a In ('Reg Query %%swUninst_%%%%P%% ^| FINDSTR \"{26A24AE4-039D-4CA4-87B4-2F832[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp032.cfg"
ECHO Title="Java SE Runtime Environment %MAJ% Update %MIN% x86">> "%~dp032.cfg"
ECHO Title="Java SE Runtime Environment %MAJ% Update %MIN% x86">> "%~dp032.cfg"
ECHO BeginPrompt="\n\nThis will install Java %MAJ% Update %MIN% x86 with Web plugins\nAny previous Java x86 version(s) will be uninstalled first\n\n\nAvailable command-line switch:\n\n-ai\tSilent installation with Web plugins\n-ai1\tSilent installation without Web plugins\n\nClick \"OK\" to begin installation.  Click \"Cancel\" to exit.">> "%~dp032.cfg"
ECHO ExtractTitle="Java SE Runtime Environment %MAJ% Update %MIN% x86">> "%~dp032.cfg"
ECHO ExtractDialogText="Please wait while the installation routine is extracted">> "%~dp032.cfg"
ECHO FinishMessage="Java SE %MAJ% Update %MIN% x86 has been installed.">> "%~dp032.cfg"
ECHO GUIMode="1">> "%~dp032.cfg"
ECHO GUIFlags="6153">> "%~dp032.cfg"
ECHO MiscFlags="4">> "%~dp032.cfg"
ECHO RunProgram="%%DelOldVer%% /qn">> "%~dp032.cfg"
ECHO RunProgram="jre_inst.msi /qb!">> "%~dp032.cfg"
ECHO RunProgram="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"
ECHO RunProgram="x64:hidcon:cmd /c \"%programfiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"
ECHO AutoInstall="%%DelOldVer%% /qn">> "%~dp032.cfg"
ECHO AutoInstall="jre_inst.msi /qn">> "%~dp032.cfg"
ECHO AutoInstall="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"
ECHO AutoInstall="x64:hidcon:cmd /c \"%programfiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"
ECHO AutoInstall1="%%DelOldVer%% /qn">> "%~dp032.cfg"
ECHO AutoInstall1="jre_inst.msi /qn WEB_JAVA=0">> "%~dp032.cfg"
ECHO AutoInstall1="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"
ECHO AutoInstall1="x64:hidcon:cmd /c \"%programfiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"
ECHO ;!@InstallEnd@!>> "%~dp032.cfg"
ECHO. >> "%~dp032.cfg"
GOTO :EOF
 
 
 
:CONFIG_64
ECHO ;!@Install@!UTF-8!> "%~dp064.cfg"
ECHO SetEnvironment="swUninst=HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp064.cfg"
ECHO SetEnvironment="DelOldVer64=hidcon:cmd /c For /F \"tokens=2 delims={}\" %%a In ('Reg Query %%swUninst%% ^| FINDSTR \"{26A24AE4-039D-4CA4-87B4-2F864[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp064.cfg"
ECHO Title="Java SE Runtime Environment %MAJ% Update %MIN% x64">> "%~dp064.cfg"
ECHO BeginPrompt="\n\nThis will install Java %MAJ% Update %MIN% x64 with Web plugins\nAny previous Java x64 version(s) will be uninstalled first\n\n\nAvailable command-line switch:\n\n-ai\tSilent installation with Web plugins\n-ai1\tSilent installation without Web plugins\n\nClick \"OK\" to begin installation.  Click \"Cancel\" to exit.">> "%~dp064.cfg"
ECHO ExtractTitle="Java SE Runtime Environment %MAJ% Update %MIN% x64">> "%~dp064.cfg"
ECHO ExtractDialogText="Please wait while the installation routine is extracted">> "%~dp064.cfg"
ECHO FinishMessage="Java %MAJ% Update %MIN% x64 has been installed.">> "%~dp064.cfg"
ECHO GUIMode="1">> "%~dp064.cfg"
ECHO GUIFlags="6153">> "%~dp064.cfg"
ECHO MiscFlags="4">> "%~dp064.cfg"
ECHO RunProgram="x64:%%DelOldVer64%% /qn">> "%~dp064.cfg"
ECHO RunProgram="x64:jre64_inst.msi /qb!">> "%~dp064.cfg"
ECHO AutoInstall="x64:%%DelOldVer64%% /qn">> "%~dp064.cfg"
ECHO AutoInstall="x64:jre64_inst.msi /qn">> "%~dp064.cfg"
ECHO AutoInstall1="x64:%%DelOldVer64%% /qn">> "%~dp064.cfg"
ECHO AutoInstall1="x64:jre64_inst.msi /qn WEB_JAVA=0">> "%~dp064.cfg"
ECHO ;!@InstallEnd@!>> "%~dp064.cfg"
ECHO. >> "%~dp064.cfg"
GOTO :EOF
 
 
 
:CONFIG_AIO
ECHO ;!@Install@!UTF-8!> "%~dp0AIO.cfg"
ECHO SetEnvironment="swUninst_x64=HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp0AIO.cfg"
ECHO SetEnvironment="swUninst_x86=HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp0AIO.cfg"
ECHO SetEnvironment="DelOldVer=%%%%P:hidcon:cmd /c For /F \"tokens=2 delims={}\" %%a In ('Reg Query %%swUninst_%%%%P%% ^| FINDSTR \"{26A24AE4-039D-4CA4-87B4-2F832[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp0AIO.cfg"
ECHO SetEnvironment="DelOldVer64=hidcon:cmd /c For /F \"tokens=2 delims={}\" %%a In ('Reg Query %%swUninst_x86%% ^| FINDSTR \"{26A24AE4-039D-4CA4-87B4-2F864[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp0AIO.cfg"
ECHO Title="Java SE Runtime Environment %MAJ% Update %MIN% DUAL">> "%~dp0AIO.cfg"
ECHO BeginPrompt="\n\nThis will install Java %MAJ% Update %MIN% DUAL with Web plugins\nAny previous Java version(s) will be uninstalled first\n\n\nAvailable command-line switch:\n\n-ai\tSilent installation with Web plugins\n-ai1\tSilent installation without Web plugins\n\nClick \"OK\" to begin installation.  Click \"Cancel\" to exit.">> "%~dp0AIO.cfg"
ECHO ExtractTitle="Java SE Runtime Environment %MAJ% Update %MIN% DUAL">> "%~dp0AIO.cfg"
ECHO ExtractDialogText="Please wait while the installation routine is extracted">> "%~dp0AIO.cfg"
ECHO FinishMessage="Java %MAJ% Update %MIN% DUAL has been installed.">> "%~dp0AIO.cfg"
ECHO GUIMode="1">> "%~dp0AIO.cfg"
ECHO GUIFlags="6153">> "%~dp0AIO.cfg"
ECHO MiscFlags="4">> "%~dp0AIO.cfg"
ECHO RunProgram="%%DelOldVer%% /qn">> "%~dp0AIO.cfg"
ECHO RunProgram="x64:%%DelOldVer64%% /qn">> "%~dp0AIO.cfg"
ECHO RunProgram="jre_inst.msi /qb!">> "%~dp0AIO.cfg"
ECHO RunProgram="x64:jre64_inst.msi /qb!">> "%~dp0AIO.cfg"
ECHO RunProgram="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"
ECHO RunProgram="x64:hidcon:cmd /c \"%ProgramFiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"
ECHO AutoInstall="%%DelOldVer%% /qn">> "%~dp0AIO.cfg"
ECHO AutoInstall="x64:%%DelOldVer64%% /qn">> "%~dp0AIO.cfg"
ECHO AutoInstall="jre_inst.msi /qn">> "%~dp0AIO.cfg"
ECHO AutoInstall="x64:jre64_inst.msi /qn">> "%~dp0AIO.cfg"
ECHO AutoInstall="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"
ECHO AutoInstall="x64:hidcon:cmd /c \"%ProgramFiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"
ECHO AutoInstall1="%%DelOldVer%% /qn">> "%~dp0AIO.cfg"
ECHO AutoInstall1="x64:%%DelOldVer64%% /qn">> "%~dp0AIO.cfg"
ECHO AutoInstall1="jre_inst.msi /qn WEB_JAVA=0">> "%~dp0AIO.cfg"
ECHO AutoInstall1="x64:jre64_inst.msi /qn WEB_JAVA=0">> "%~dp0AIO.cfg"
ECHO AutoInstall1="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"
ECHO AutoInstall1="x64:hidcon:cmd /c \"%ProgramFiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"
ECHO ;!@InstallEnd@!>> "%~dp0AIO.cfg"
ECHO. >> "%~dp0AIO.cfg"
GOTO :EOF
 
 
 
:ENTRIES_INI
ECHO [general]> "%~dp0ENTRIES_Java.ini"
ECHO builddate=%date%>> "%~dp0ENTRIES_Java.ini"
ECHO description=Java SE Runtime Environment %MAJ% update %MIN% x86>> "%~dp0ENTRIES_Java.ini"
ECHO language=Multi>> "%~dp0ENTRIES_Java.ini"
ECHO version=1.%JAVAVER%>> "%~dp0ENTRIES_Java.ini"
ECHO website=http://www.java.com/>>"%~dp0ENTRIES_Java.ini"
ECHO. >> "%~dp0ENTRIES_Java.ini"
ECHO [EditFile]>> "%~dp0ENTRIES_Java.ini"
ECHO I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram>> "%~dp0ENTRIES_Java.ini"
ECHO. >> "%~dp0ENTRIES_Java.ini"
ECHO [AddProgram]>> "%~dp0ENTRIES_Java.ini"
ECHO Java%JAVAVER%.exe -ai>> "%~dp0ENTRIES_Java.ini"
ECHO. >> "%~dp0ENTRIES_Java.ini"
ECHO ; "Java%JAVAVER%.exe -ai1" for install without Web plugins>> "%~dp0ENTRIES_Java.ini"
GOTO :EOF
 
:ENTRIES_INI_64
ECHO [general]> "%~dp0ENTRIES_Java.ini"
ECHO builddate=%date%>> "%~dp0ENTRIES_Java.ini"
ECHO description=Java SE Runtime Environment %MAJ% update %MIN% x64>> "%~dp0ENTRIES_Java.ini"
ECHO language=Multi>> "%~dp0ENTRIES_Java.ini"
ECHO version=1.%JAVAVER64%>> "%~dp0ENTRIES_Java.ini"
ECHO website=http://www.java.com/>>"%~dp0ENTRIES_Java.ini"
ECHO. >> "%~dp0ENTRIES_Java.ini"
ECHO [EditFile]>> "%~dp0ENTRIES_Java.ini"
ECHO I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram>> "%~dp0ENTRIES_Java.ini"
ECHO. >> "%~dp0ENTRIES_Java.ini"
ECHO [AddProgram]>> "%~dp0ENTRIES_Java.ini"
ECHO Java%JAVAVER64%.exe -ai>> "%~dp0ENTRIES_Java.ini"
ECHO. >> "%~dp0ENTRIES_Java.ini"
ECHO ; "Java%JAVAVER64%.exe -ai1" for install without Web plugins>> "%~dp0ENTRIES_Java.ini"
GOTO :EOF
 
 
:ENTRIES_INI_AIO
ECHO [general]> "%~dp0ENTRIES_Java.ini"
ECHO builddate=%date%>> "%~dp0ENTRIES_Java.ini"
ECHO description=Java SE Runtime Environment %MAJ% update %MIN% Dual>> "%~dp0ENTRIES_Java.ini"
ECHO language=Multi>> "%~dp0ENTRIES_Java.ini"
ECHO version=1.%JAVAVER%_x86 + 1.%JAVAVER64%_x64>> "%~dp0ENTRIES_Java.ini"
ECHO website=http://www.java.com/>>"%~dp0ENTRIES_Java.ini"
ECHO. >> "%~dp0ENTRIES_Java.ini"
ECHO [EditFile]>> "%~dp0ENTRIES_Java.ini"
ECHO I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram>> "%~dp0ENTRIES_Java.ini"
ECHO. >> "%~dp0ENTRIES_Java.ini"
ECHO [AddProgram]>> "%~dp0ENTRIES_Java.ini"
ECHO Java%JAVAVER64%.exe -ai>> "%~dp0ENTRIES_Java.ini"
ECHO. >> "%~dp0ENTRIES_Java.ini"
ECHO ; "Java%JAVAVER64%.exe -ai1" for install without Web plugins>> "%~dp0ENTRIES_Java.ini"
GOTO :EOF
 
 
:GETJAVAVER
if /i "%1" GTR "%JAVAFILE%" (set JAVAFILE=%1&&set JAVAFN=%~n1)
goto :eof
 
:GETJAVAVER64
if /i "%1" GTR "%JAVAFILE64%" (set JAVAFILE64=%1&&set JAVAFN64=%~n1)
goto :eof
 
:NoJavaInst
echo ================================================================================
echo ================================================================================
echo. JRE x86 and/or x64 redistributable not found.  
echo. Place it/them in the same directory than this script.
echo. Correct JRE install name for x86 is "jre-XuXX-windows-i586.exe".
echo. Correct JRE install name for x64 is "jre-XuXX-windows-x64.exe".
echo ================================================================================
echo ================================================================================
pause
goto :eof
 
 
:NoResExtr
echo ================================================================================
echo ================================================================================
echo. NirSoft ResourcesExtract not found. Download and unpack it in "bin" directory.
echo. Get it here - http://nirsoft.net/utils/resources_extract.html
echo ================================================================================
echo ================================================================================
pause
goto :eof
 
 
:No7za
echo ================================================================================
echo ================================================================================
echo. 7za.exe not found. Download and unpack it in "bin" directory.
echo. Get it here - http://sourceforge.net/projects/sevenzip/files/7-Zip/
echo ================================================================================
echo ================================================================================
pause
goto :eof
 
:No7SFX
echo ================================================================================
echo ================================================================================
echo. JavaInst.sfx not found. Place it in "bin" directory.
echo ================================================================================
echo ================================================================================
pause
goto :eof

Edited by papageorgiou
Link to comment
Share on other sites

  • 1 month later...

Here was my solution.

 

I first noticed with 8u20 that the 64bit version when extracted had different file names so the rename commands failed.

ren "%~dp0JRE_TEMP64\%JAVAFN64%_101_JAVA_INSTALLER.bin" jre64_inst.msi

ren "%~dp0JRE_TEMP64\%JAVAFN64%_102_JAVA_INSTALLER.bin" Data1.cab

 

needed to be changed to

ren "%~dp0JRE_TEMP64\%JAVAFN64%_105_JAVA_INSTALLER.bin" jre64_inst.msi

ren "%~dp0JRE_TEMP64\%JAVAFN64%_103_JAVA_INSTALLER.bin" Data1.cab

 

Then with 8u25, the files did not extract correctly, so I changed the script (see below) to launch the exe(s) and then grab the msi from the profile temp and then kill the exe(s).  It seems to work nicely so far.

 

The lines in bold are where the changes can be found.

 

@echo off

setlocal enableextensions

if not exist "%~dp0bin\7za.exe" goto :No7za

if not exist "%~dp0bin\JavaInst.sfx" goto :No7SFX

if not exist "%~dp0bin\ResourcesExtract.exe" goto :NoResExtr

SET SZ="%~dp0bin\7za.exe"

if exist "%~dp0jre-*-windows-i586.exe" GOTO :X86

if not exist "%~dp0jre-*-windows-i586.exe" GOTO :X64

 

 

 

:X86

if exist "%~dp0jre-*-windows-x64.exe" GOTO :DUAL

set JAVAFILE=

for %%j in (%~dp0jre-*-windows-i586.exe) do call :GETJAVAVER %%~nxj

if "%JAVAFILE%"=="" goto :NoJavaInst

for /f "delims=- tokens=2" %%j in ("%JAVAFILE%") do set JAVAVER=%%j

SET MAJ=%JAVAVER:~0,1%

SET MIN=%JAVAVER:~2,3%

if exist "%~dp0JRE_TEMP" rmdir /s /q "%~dp0JRE_TEMP"

mkdir "%~dp0JRE_TEMP"

::start /w "Unpacking JRE..." "%~dp0bin\ResourcesExtract.exe" /Source "%~dp0%JAVAFILE%" /DestFolder "%~dp0JRE_TEMP" /ExtractIcons 0 /ExtractCursors 0 /ExtractBitmaps 0 /ExtractHTML 0 /ExtractManifests 0 /ExtractAnimatedIcons 0 /ExtractAnimatedCursors 0 /ExtractAVI 0 /ExtractTypeLib 0 /ExtractBinary 1 /ScanSubFolders 0 /FileExistMode 1 /OpenDestFolder 0

::ren "%~dp0JRE_TEMP\%JAVAFN%_101_JAVA_INSTALLER.bin" jre_inst.msi

::ren "%~dp0JRE_TEMP\%JAVAFN%_102_JAVA_INSTALLER.bin" Data1.cab

::del /f /q "%~dp0JRE_TEMP\%JAVAFN%*"

 

ECHO.

ECHO Launching JRE 32bit to grab msi . . .

start "Launching JRE 32bit to grab msi . . ." "%~dp0%JAVAFILE%"

if exist "%~dp0JRE_ADMAIO" rmdir /s /q "%~dp0JRE_ADMAIO"

mkdir "%~dp0JRE_ADMAIO"

:DUAL32BITLOOP

IF NOT EXIST "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%\jre1.%MAJ%.0_%MIN%.msi" GOTO :DUAL32BITLOOP

ping -n 10 127.0.0.1>nul

copy "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%\jre1.%MAJ%.0_%MIN%.msi" "%~dp0JRE_TEMP\jre_inst.msi"

ping -n 2 127.0.0.1>nul

TASKKILL /F /IM %JAVAFILE%

 

start /w "Creating administrative installation point..." msiexec /a "%~dp0JRE_TEMP\jre_inst.msi" /qb! TARGETDIR="%~dp0JRE_ADM"

rmdir /s /q "%~dp0JRE_TEMP"

%SZ% a "%~dp0JavaInst.7z" "%~dp0JRE_ADM\*" -mx=9 -mmt=off -m0=BCJ2 -m1=LZMA:d27:fb=128:mc=256 -m2=LZMA:d24:fb=128:mc=256 -m3=LZMA:d24:fb=128:mc=256 -mb0:1 -mb0s1:2 -mb0s2:3 -r

call :CONFIG

copy /b /y "%~dp0bin\JavaInst.sfx"+"%~dp032.cfg"+"%~dp0JavaInst.7z" "%~dp0Java%JAVAVER%.exe"

rmdir /s /q "%~dp0JRE_ADM"

del /f /q "%~dp0JavaInst.7z"

mkdir "%~dp0svcpack"

copy /b /y "%~dp0Java%JAVAVER%.exe" "%~dp0svcpack\Java%JAVAVER%.exe"

call :ENTRIES_INI

%SZ% a "%~dp0Java_Runtime_%MAJ%_update_%MIN%_AddOn.zip" "%~dp0ENTRIES_Java.ini" "%~dp0svcpack"

del /f /q "%~dp032.cfg"

del /f /q "%~dp0ENTRIES_Java.ini"

rmdir /s /q "%~dp0svcpack"

exit /b

 

 

:X64

set JAVAFILE64=

for %%k in (%~dp0jre-*-windows-x64.exe) do call :GETJAVAVER64 %%~nxk

if "%JAVAFILE64%"=="" goto :NoJavaInst

if not exist "%~dp0bin\ResourcesExtract.exe" goto :NoResExtr

for /f "delims=- tokens=2" %%k in ("%JAVAFILE64%") do set JAVAVER64=%%k

SET MAJ=%JAVAVER64:~0,1%

SET MIN=%JAVAVER64:~2,3%

echo JRE newest version found^: 1.%JAVAVER64%

echo Java file name only - %JAVAFN64%

if exist "%~dp0JRE_TEMP64" rmdir /s /q "%~dp0JRE_TEMP64"

mkdir "%~dp0JRE_TEMP64"

::start /w "Unpacking JRE..." "%~dp0bin\ResourcesExtract.exe" /Source "%~dp0%JAVAFILE64%" /DestFolder "%~dp0JRE_TEMP64" /ExtractIcons 0 /ExtractCursors 0 /ExtractBitmaps 0 /ExtractHTML 0 /ExtractManifests 0 /ExtractAnimatedIcons 0 /ExtractAnimatedCursors 0 /ExtractAVI 0 /ExtractTypeLib 0 /ExtractBinary 1 /ScanSubFolders 0 /FileExistMode 1 /OpenDestFolder 0

::ren "%~dp0JRE_TEMP64\%JAVAFN64%_105_JAVA_INSTALLER.bin" jre64_inst.msi

::ren "%~dp0JRE_TEMP64\%JAVAFN64%_103_JAVA_INSTALLER.bin" Data1.cab

::del /f /q "%~dp0JRE_TEMP64\%JAVAFN64%*"

 

ECHO.

ECHO Launching JRE 64bit to grab msi . . .

start "Launching JRE 64bit to grab msi . . ." "%~dp0%JAVAFILE64%"

:DUAL64BITLOOP

IF NOT EXIST "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%_x64\jre1.%MAJ%.0_%MIN%.msi" GOTO :DUAL64BITLOOP

ping -n 10 127.0.0.1>nul

copy "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%_x64\jre1.%MAJ%.0_%MIN%.msi" "%~dp0JRE_TEMP64\jre64_inst.msi"

ping -n 2 127.0.0.1>nul

TASKKILL /F /IM %JAVAFILE64%

 

if exist "%~dp0JRE_ADM64" rmdir /s /q "%~dp0JRE_ADM64"

mkdir "%~dp0JRE_ADM64"

start /w "Creating administrative installation point..." msiexec /a "%~dp0JRE_TEMP64\jre64_inst.msi" /qb! TARGETDIR="%~dp0JRE_ADM64"

rmdir /s /q "%~dp0JRE_TEMP64"

%SZ% a "%~dp0JavaInst-x64.7z" "%~dp0JRE_ADM64\*" -mx=9 -mmt=off -m0=BCJ2 -m1=LZMA:d27:fb=128:mc=256 -m2=LZMA:d24:fb=128:mc=256 -m3=LZMA:d24:fb=128:mc=256 -mb0:1 -mb0s1:2 -mb0s2:3 -r

call :CONFIG_64

copy /b /y "%~dp0bin\JavaInst.sfx"+"%~dp064.cfg"+"%~dp0JavaInst-x64.7z" "%~dp0Java%JAVAVER64%-x64.exe"

rmdir /s /q "%~dp0JRE_ADM64"

del /f /q "%~dp0JavaInst-x64.7z"

del /f /q "%~dp064.cfg"

mkdir "%~dp0svcpack"

copy /b /y "%~dp0Java%JAVAVER64%-x64.exe" "%~dp0svcpack\Java%JAVAVER64%.exe"

call :ENTRIES_INI_64

%SZ% a "%~dp0Java_Runtime_%MAJ%_update_%MIN%_x64_AddOn.zip" "%~dp0ENTRIES_Java.ini" "%~dp0svcpack"

del /f /q "%~dp0ENTRIES_Java.ini"

rmdir /s /q "%~dp0svcpack"

exit /b

 

 

 

:DUAL

set JAVAFILE=

for %%j in (%~dp0jre-*-windows-i586.exe) do call :GETJAVAVER %%~nxj

if "%JAVAFILE%"=="" goto :NoJavaInst

for /f "delims=- tokens=2" %%j in ("%JAVAFILE%") do set JAVAVER=%%j

SET MAJ=%JAVAVER:~0,1%

SET MIN=%JAVAVER:~2,3%

echo JRE newest version found^: 1.%JAVAVER%

echo Java file name only - %JAVAFN%

if exist "%~dp0JRE_TEMP" rmdir /s /q "%~dp0JRE_TEMP"

mkdir "%~dp0JRE_TEMP"

::start /w "Unpacking JRE..." "%~dp0bin\ResourcesExtract.exe" /Source "%~dp0%JAVAFILE%" /DestFolder "%~dp0JRE_TEMP" /ExtractIcons 0 /ExtractCursors 0 /ExtractBitmaps 0 /ExtractHTML 0 /ExtractManifests 0 /ExtractAnimatedIcons 0 /ExtractAnimatedCursors 0 /ExtractAVI 0 /ExtractTypeLib 0 /ExtractBinary 1 /ScanSubFolders 0 /FileExistMode 1 /OpenDestFolder 0

::ren "%~dp0JRE_TEMP\%JAVAFN%_101_JAVA_INSTALLER.bin" jre_inst.msi

::ren "%~dp0JRE_TEMP\%JAVAFN%_102_JAVA_INSTALLER.bin" Data1.cab

::del /f /q "%~dp0JRE_TEMP\%JAVAFN%*"

 

ECHO.

ECHO Launching JRE 32bit to grab msi . . .

start "Launching JRE 32bit to grab msi . . ." "%~dp0%JAVAFILE%"

if exist "%~dp0JRE_ADMAIO" rmdir /s /q "%~dp0JRE_ADMAIO"

mkdir "%~dp0JRE_ADMAIO"

:DUAL32BITLOOP

IF NOT EXIST "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%\jre1.%MAJ%.0_%MIN%.msi" GOTO :DUAL32BITLOOP

ping -n 10 127.0.0.1>nul

copy "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%\jre1.%MAJ%.0_%MIN%.msi" "%~dp0JRE_TEMP\jre_inst.msi"

ping -n 2 127.0.0.1>nul

TASKKILL /F /IM %JAVAFILE%

 

start /w "Creating administrative installation point..." msiexec /a "%~dp0JRE_TEMP\jre_inst.msi" /qb! TARGETDIR="%~dp0JRE_ADMAIO"

rmdir /s /q "%~dp0JRE_TEMP"

 

ECHO.

 

set JAVAFILE64=

for %%k in (%~dp0jre-*-windows-x64.exe) do call :GETJAVAVER64 %%~nxk

if "%JAVAFILE64%"=="" goto :NoJavaInst

for /f "delims=- tokens=2" %%k in ("%JAVAFILE64%") do set JAVAVER64=%%k

echo JRE newest version found^: 1.%JAVAVER64%

echo Java file name only - %JAVAFN64%

if exist "%~dp0JRE_TEMP64" rmdir /s /q "%~dp0JRE_TEMP64"

mkdir "%~dp0JRE_TEMP64"

::start /w "Unpacking JRE..." "%~dp0bin\ResourcesExtract.exe" /Source "%~dp0%JAVAFILE64%" /DestFolder "%~dp0JRE_TEMP64" /ExtractIcons 0 /ExtractCursors 0 /ExtractBitmaps 0 /ExtractHTML 0 /ExtractManifests 0 /ExtractAnimatedIcons 0 /ExtractAnimatedCursors 0 /ExtractAVI 0 /ExtractTypeLib 0 /ExtractBinary 1 /ScanSubFolders 0 /FileExistMode 1 /OpenDestFolder 0

::ren "%~dp0JRE_TEMP64\%JAVAFN64%_105_JAVA_INSTALLER.bin" jre64_inst.msi

::ren "%~dp0JRE_TEMP64\%JAVAFN64%_103_JAVA_INSTALLER.bin" Data1.cab

 

ECHO.

ECHO Launching JRE 64bit to grab msi . . .

start "Launching JRE 64bit to grab msi . . ." "%~dp0%JAVAFILE64%"

:DUAL64BITLOOP

IF NOT EXIST "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%_x64\jre1.%MAJ%.0_%MIN%.msi" GOTO :DUAL64BITLOOP

ping -n 10 127.0.0.1>nul

copy "%USERPROFILE%\AppData\LocalLow\Sun\Java\jre1.%MAJ%.0_%MIN%_x64\jre1.%MAJ%.0_%MIN%.msi" "%~dp0JRE_TEMP64\jre64_inst.msi"

ping -n 2 127.0.0.1>nul

TASKKILL /F /IM %JAVAFILE64%

 

start /w "Creating administrative installation point..." msiexec /a "%~dp0JRE_TEMP64\jre64_inst.msi" /qb! TARGETDIR="%~dp0JRE_ADMAIO"

rmdir /s /q "%~dp0JRE_TEMP64"

%SZ% a "%~dp0JavaInst-AIO.7z" "%~dp0JRE_ADMAIO\*" -mx=9 -mmt=off -m0=BCJ2 -m1=LZMA:d27:fb=128:mc=256 -m2=LZMA:d24:fb=128:mc=256 -m3=LZMA:d24:fb=128:mc=256 -mb0:1 -mb0s1:2 -mb0s2:3 -r

call :CONFIG_AIO

copy /b /y "%~dp0bin\JavaInst.sfx"+"%~dp0AIO.cfg"+"%~dp0JavaInst-AIO.7z" "%~dp0Java%JAVAVER64%-Dual.exe"

rmdir /s /q "%~dp0JRE_ADMAIO"

del /f /q "%~dp0JavaInst-AIO.7z"

del /f /q "%~dp0AIO.cfg"

mkdir "%~dp0svcpack"

copy /b /y "%~dp0Java%JAVAVER64%-Dual.exe" "%~dp0svcpack\Java%JAVAVER64%.exe"

call :ENTRIES_INI_AIO

%SZ% a "%~dp0Java_Runtime_%MAJ%_update_%MIN%_Dual_AddOn.zip" "%~dp0ENTRIES_Java.ini" "%~dp0svcpack"

del /f /q "%~dp0ENTRIES_Java.ini"

rmdir /s /q "%~dp0svcpack"

exit /b

 

 

 

:CONFIG

ECHO ;!@Install@!UTF-8!> "%~dp032.cfg"

ECHO SetEnvironment="swUninst_x64=HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp032.cfg"

ECHO SetEnvironment="swUninst_x86=HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp032.cfg"

ECHO SetEnvironment="DelOldVer=%%%%P:hidcon:cmd /c For /F \"tokens=2 delims={}\" %%a In ('Reg Query %%swUninst_%%%%P%% ^| FINDSTR \"{26A24AE4-039D-4CA4-87B4-2F832[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp032.cfg"

ECHO Title="Java SE Runtime Environment %MAJ% Update %MIN% x86">> "%~dp032.cfg"

ECHO Title="Java SE Runtime Environment %MAJ% Update %MIN% x86">> "%~dp032.cfg"

ECHO BeginPrompt="\n\nThis will install Java %MAJ% Update %MIN% x86 with Web plugins\nAny previous Java x86 version(s) will be uninstalled first\n\n\nAvailable command-line switch:\n\n-ai\tSilent installation with Web plugins\n-ai1\tSilent installation without Web plugins\n\nClick \"OK\" to begin installation.  Click \"Cancel\" to exit.">> "%~dp032.cfg"

ECHO ExtractTitle="Java SE Runtime Environment %MAJ% Update %MIN% x86">> "%~dp032.cfg"

ECHO ExtractDialogText="Please wait while the installation routine is extracted">> "%~dp032.cfg"

ECHO FinishMessage="Java SE %MAJ% Update %MIN% x86 has been installed.">> "%~dp032.cfg"

ECHO GUIMode="1">> "%~dp032.cfg"

ECHO GUIFlags="6153">> "%~dp032.cfg"

ECHO MiscFlags="4">> "%~dp032.cfg"

ECHO RunProgram="%%DelOldVer%% /qn">> "%~dp032.cfg"

ECHO RunProgram="jre_inst.msi /qb!">> "%~dp032.cfg"

ECHO RunProgram="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"

ECHO RunProgram="x64:hidcon:cmd /c \"%programfiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"

ECHO AutoInstall="%%DelOldVer%% /qn">> "%~dp032.cfg"

ECHO AutoInstall="jre_inst.msi /qn">> "%~dp032.cfg"

ECHO AutoInstall="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"

ECHO AutoInstall="x64:hidcon:cmd /c \"%programfiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"

ECHO AutoInstall1="%%DelOldVer%% /qn">> "%~dp032.cfg"

ECHO AutoInstall1="jre_inst.msi /qn WEB_JAVA=0">> "%~dp032.cfg"

ECHO AutoInstall1="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"

ECHO AutoInstall1="x64:hidcon:cmd /c \"%programfiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp032.cfg"

ECHO ;!@InstallEnd@!>> "%~dp032.cfg"

ECHO. >> "%~dp032.cfg"

GOTO :EOF

 

 

 

:CONFIG_64

ECHO ;!@Install@!UTF-8!> "%~dp064.cfg"

ECHO SetEnvironment="swUninst=HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp064.cfg"

ECHO SetEnvironment="DelOldVer64=hidcon:cmd /c For /F \"tokens=2 delims={}\" %%a In ('Reg Query %%swUninst%% ^| FINDSTR \"{26A24AE4-039D-4CA4-87B4-2F864[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp064.cfg"

ECHO Title="Java SE Runtime Environment %MAJ% Update %MIN% x64">> "%~dp064.cfg"

ECHO BeginPrompt="\n\nThis will install Java %MAJ% Update %MIN% x64 with Web plugins\nAny previous Java x64 version(s) will be uninstalled first\n\n\nAvailable command-line switch:\n\n-ai\tSilent installation with Web plugins\n-ai1\tSilent installation without Web plugins\n\nClick \"OK\" to begin installation.  Click \"Cancel\" to exit.">> "%~dp064.cfg"

ECHO ExtractTitle="Java SE Runtime Environment %MAJ% Update %MIN% x64">> "%~dp064.cfg"

ECHO ExtractDialogText="Please wait while the installation routine is extracted">> "%~dp064.cfg"

ECHO FinishMessage="Java %MAJ% Update %MIN% x64 has been installed.">> "%~dp064.cfg"

ECHO GUIMode="1">> "%~dp064.cfg"

ECHO GUIFlags="6153">> "%~dp064.cfg"

ECHO MiscFlags="4">> "%~dp064.cfg"

ECHO RunProgram="x64:%%DelOldVer64%% /qn">> "%~dp064.cfg"

ECHO RunProgram="x64:jre64_inst.msi /qb!">> "%~dp064.cfg"

ECHO AutoInstall="x64:%%DelOldVer64%% /qn">> "%~dp064.cfg"

ECHO AutoInstall="x64:jre64_inst.msi /qn">> "%~dp064.cfg"

ECHO AutoInstall1="x64:%%DelOldVer64%% /qn">> "%~dp064.cfg"

ECHO AutoInstall1="x64:jre64_inst.msi /qn WEB_JAVA=0">> "%~dp064.cfg"

ECHO ;!@InstallEnd@!>> "%~dp064.cfg"

ECHO. >> "%~dp064.cfg"

GOTO :EOF

 

 

 

:CONFIG_AIO

ECHO ;!@Install@!UTF-8!> "%~dp0AIO.cfg"

ECHO SetEnvironment="swUninst_x64=HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp0AIO.cfg"

ECHO SetEnvironment="swUninst_x86=HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall">> "%~dp0AIO.cfg"

ECHO SetEnvironment="DelOldVer=%%%%P:hidcon:cmd /c For /F \"tokens=2 delims={}\" %%a In ('Reg Query %%swUninst_%%%%P%% ^| FINDSTR \"{26A24AE4-039D-4CA4-87B4-2F832[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp0AIO.cfg"

ECHO SetEnvironment="DelOldVer64=hidcon:cmd /c For /F \"tokens=2 delims={}\" %%a In ('Reg Query %%swUninst_x86%% ^| FINDSTR \"{26A24AE4-039D-4CA4-87B4-2F864[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp0AIO.cfg"

ECHO Title="Java SE Runtime Environment %MAJ% Update %MIN% DUAL">> "%~dp0AIO.cfg"

ECHO BeginPrompt="\n\nThis will install Java %MAJ% Update %MIN% DUAL with Web plugins\nAny previous Java version(s) will be uninstalled first\n\n\nAvailable command-line switch:\n\n-ai\tSilent installation with Web plugins\n-ai1\tSilent installation without Web plugins\n\nClick \"OK\" to begin installation.  Click \"Cancel\" to exit.">> "%~dp0AIO.cfg"

ECHO ExtractTitle="Java SE Runtime Environment %MAJ% Update %MIN% DUAL">> "%~dp0AIO.cfg"

ECHO ExtractDialogText="Please wait while the installation routine is extracted">> "%~dp0AIO.cfg"

ECHO FinishMessage="Java %MAJ% Update %MIN% DUAL has been installed.">> "%~dp0AIO.cfg"

ECHO GUIMode="1">> "%~dp0AIO.cfg"

ECHO GUIFlags="6153">> "%~dp0AIO.cfg"

ECHO MiscFlags="4">> "%~dp0AIO.cfg"

ECHO RunProgram="%%DelOldVer%% /qn">> "%~dp0AIO.cfg"

ECHO RunProgram="x64:%%DelOldVer64%% /qn">> "%~dp0AIO.cfg"

ECHO RunProgram="jre_inst.msi /qb!">> "%~dp0AIO.cfg"

ECHO RunProgram="x64:jre64_inst.msi /qb!">> "%~dp0AIO.cfg"

ECHO RunProgram="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"

ECHO RunProgram="x64:hidcon:cmd /c \"%ProgramFiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"

ECHO AutoInstall="%%DelOldVer%% /qn">> "%~dp0AIO.cfg"

ECHO AutoInstall="x64:%%DelOldVer64%% /qn">> "%~dp0AIO.cfg"

ECHO AutoInstall="jre_inst.msi /qn">> "%~dp0AIO.cfg"

ECHO AutoInstall="x64:jre64_inst.msi /qn">> "%~dp0AIO.cfg"

ECHO AutoInstall="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"

ECHO AutoInstall="x64:hidcon:cmd /c \"%ProgramFiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"

ECHO AutoInstall1="%%DelOldVer%% /qn">> "%~dp0AIO.cfg"

ECHO AutoInstall1="x64:%%DelOldVer64%% /qn">> "%~dp0AIO.cfg"

ECHO AutoInstall1="jre_inst.msi /qn WEB_JAVA=0">> "%~dp0AIO.cfg"

ECHO AutoInstall1="x64:jre64_inst.msi /qn WEB_JAVA=0">> "%~dp0AIO.cfg"

ECHO AutoInstall1="x86:hidcon:cmd /c \"%programfiles%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"

ECHO AutoInstall1="x64:hidcon:cmd /c \"%ProgramFiles(x86)%\\Java\\jre%MAJ%\\bin\\jqs.exe\" -unregister">> "%~dp0AIO.cfg"

ECHO ;!@InstallEnd@!>> "%~dp0AIO.cfg"

ECHO. >> "%~dp0AIO.cfg"

GOTO :EOF

 

 

 

:ENTRIES_INI

ECHO [general]> "%~dp0ENTRIES_Java.ini"

ECHO builddate=%date%>> "%~dp0ENTRIES_Java.ini"

ECHO description=Java SE Runtime Environment %MAJ% update %MIN% x86>> "%~dp0ENTRIES_Java.ini"

ECHO language=Multi>> "%~dp0ENTRIES_Java.ini"

ECHO version=1.%JAVAVER%>> "%~dp0ENTRIES_Java.ini"

ECHO website=http://www.java.com/>>"%~dp0ENTRIES_Java.ini"

ECHO. >> "%~dp0ENTRIES_Java.ini"

ECHO [EditFile]>> "%~dp0ENTRIES_Java.ini"

ECHO I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram>> "%~dp0ENTRIES_Java.ini"

ECHO. >> "%~dp0ENTRIES_Java.ini"

ECHO [AddProgram]>> "%~dp0ENTRIES_Java.ini"

ECHO Java%JAVAVER%.exe -ai>> "%~dp0ENTRIES_Java.ini"

ECHO. >> "%~dp0ENTRIES_Java.ini"

ECHO ; "Java%JAVAVER%.exe -ai1" for install without Web plugins>> "%~dp0ENTRIES_Java.ini"

GOTO :EOF

 

:ENTRIES_INI_64

ECHO [general]> "%~dp0ENTRIES_Java.ini"

ECHO builddate=%date%>> "%~dp0ENTRIES_Java.ini"

ECHO description=Java SE Runtime Environment %MAJ% update %MIN% x64>> "%~dp0ENTRIES_Java.ini"

ECHO language=Multi>> "%~dp0ENTRIES_Java.ini"

ECHO version=1.%JAVAVER64%>> "%~dp0ENTRIES_Java.ini"

ECHO website=http://www.java.com/>>"%~dp0ENTRIES_Java.ini"

ECHO. >> "%~dp0ENTRIES_Java.ini"

ECHO [EditFile]>> "%~dp0ENTRIES_Java.ini"

ECHO I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram>> "%~dp0ENTRIES_Java.ini"

ECHO. >> "%~dp0ENTRIES_Java.ini"

ECHO [AddProgram]>> "%~dp0ENTRIES_Java.ini"

ECHO Java%JAVAVER64%.exe -ai>> "%~dp0ENTRIES_Java.ini"

ECHO. >> "%~dp0ENTRIES_Java.ini"

ECHO ; "Java%JAVAVER64%.exe -ai1" for install without Web plugins>> "%~dp0ENTRIES_Java.ini"

GOTO :EOF

 

 

:ENTRIES_INI_AIO

ECHO [general]> "%~dp0ENTRIES_Java.ini"

ECHO builddate=%date%>> "%~dp0ENTRIES_Java.ini"

ECHO description=Java SE Runtime Environment %MAJ% update %MIN% Dual>> "%~dp0ENTRIES_Java.ini"

ECHO language=Multi>> "%~dp0ENTRIES_Java.ini"

ECHO version=1.%JAVAVER%_x86 + 1.%JAVAVER64%_x64>> "%~dp0ENTRIES_Java.ini"

ECHO website=http://www.java.com/>>"%~dp0ENTRIES_Java.ini"

ECHO. >> "%~dp0ENTRIES_Java.ini"

ECHO [EditFile]>> "%~dp0ENTRIES_Java.ini"

ECHO I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram>> "%~dp0ENTRIES_Java.ini"

ECHO. >> "%~dp0ENTRIES_Java.ini"

ECHO [AddProgram]>> "%~dp0ENTRIES_Java.ini"

ECHO Java%JAVAVER64%.exe -ai>> "%~dp0ENTRIES_Java.ini"

ECHO. >> "%~dp0ENTRIES_Java.ini"

ECHO ; "Java%JAVAVER64%.exe -ai1" for install without Web plugins>> "%~dp0ENTRIES_Java.ini"

GOTO :EOF

 

 

:GETJAVAVER

if /i "%1" GTR "%JAVAFILE%" (set JAVAFILE=%1&&set JAVAFN=%~n1)

goto :eof

 

:GETJAVAVER64

if /i "%1" GTR "%JAVAFILE64%" (set JAVAFILE64=%1&&set JAVAFN64=%~n1)

goto :eof

 

:NoJavaInst

echo ================================================================================

echo ================================================================================

echo. JRE x86 and/or x64 redistributable not found.  

echo. Place it/them in the same directory than this script.

echo. Correct JRE install name for x86 is "jre-XuXX-windows-i586.exe".

echo. Correct JRE install name for x64 is "jre-XuXX-windows-x64.exe".

echo ================================================================================

echo ================================================================================

pause

goto :eof

 

 

:NoResExtr

echo ================================================================================

echo ================================================================================

echo. NirSoft ResourcesExtract not found. Download and unpack it in "bin" directory.

echo. Get it here - http://nirsoft.net/utils/resources_extract.html

echo ================================================================================

echo ================================================================================

pause

goto :eof

 

 

:No7za

echo ================================================================================

echo ================================================================================

echo. 7za.exe not found. Download and unpack it in "bin" directory.

echo. Get it here - http://sourceforge.net/projects/sevenzip/files/7-Zip/

echo ================================================================================

echo ================================================================================

pause

goto :eof

 

:No7SFX

echo ================================================================================

echo ================================================================================

echo. JavaInst.sfx not found. Place it in "bin" directory.

echo ================================================================================

echo ================================================================================

pause

goto :eof

make this in cmd please..!! :crying_anim02:

Link to comment
Share on other sites

  • 3 weeks later...

@hamzaaan:

 

I don't understand your comment?  How is a cmd different than a bat file?  Can't i just copy and paste this text into a file and save it as a batch and run it like the cmd in the OP?

 

Yes you can!! Dont worry! I made it a long time ago.The only problem is that Im not able to create dula(86-64) silent instalation of Java 8.25

Link to comment
Share on other sites

 

@hamzaaan:

 

I don't understand your comment?  How is a cmd different than a bat file?  Can't i just copy and paste this text into a file and save it as a batch and run it like the cmd in the OP?

 

Yes you can!! Dont worry! I made it a long time ago.The only problem is that Im not able to create dula(86-64) silent instalation of Java 8.25

 

Will this work on XP?

Link to comment
Share on other sites

Version 2.0 of the maker, what's new:

- The script will offer the choice of the version (x86, x64, or both).
- The script will automatically download the newest version(s) of JRE (only if the setup(s) are not already in the folder, so no unnecessary download).
- The script can still be used offline if you have put the setup(s) in the same folder.
- Fix: previous Java version(s) correctly uninstalled.
- The default install is without Web plugins
Link to comment
Share on other sites

Hi mooms,

 

 

Version 2.0 of the maker, what's new:

 

1) In the english batch-file there is a small section still in french:

 

 

:NoJavaInst
echo ================================================================================
echo ================================================================================
echo. L'installateur Java x86 et/ou x64 est introuvable
echo. Plachez-le(s) dans le même dossier que ce script
echo. Le nom correct pour  les versions x86 est "jre-XuXX-windows-i586.exe".
echo. Le nom correct pour les versions x64 est "jre-XuXX-windows-x64.exe".
echo ================================================================================
echo ================================================================================
pause
goto :eof

 

2) If I start the maker on a system, where the actual version is already installed, I get a small error-warning that a newer version is already installed on the system; this warning disappears on his own.

 

Regards, Thiersee

 

BTW: Happy New Year! :beerchug:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...