Jump to content
mooms

Java Multi Maker 3.5 & 4.0b4

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

Share this post


Link to post
Share on other sites

That's great mooms!  I don't have access to an XP install to test myself, so hopefully 5eraph can confirm this, since he was the one that originally posted the problem.

 

Cheers and Regards

Share this post


Link to post
Share on other sites

Hello mooms,

 

Wanted to ask if there is an option to include the -ai option directly into the SFX without showing the info message when SFX is ran.

 

Cheers

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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...''

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

""Extract the archive in a work folder with no space in the path.""  Sorry but what is taht suppose to mean?

 

I do not understand.I use winrar and the program exstact the files properly I guess?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

@bphlpt: Indeed, at that time I had just tested the install (it worked) but Java 8 itself don't run on XP.

I have edited the post to state this.

Share this post


Link to post
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

Share this post


Link to post
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:

Share this post


Link to post
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.


  • Similar Content

    • By ricktendo
      Microsoft DirectX end-user Redistributable (June 2010)
      Version: 9.29.1974
      Supported operating systems: Windows 8, Windows 7, Windows Vista, Windows Server 2012/2008+R2/2003 SP1+, Windows XP SP2+
      Website: http://www.microsoft.com/en-us/download/details.aspx?id=8109
       
       
      x86/x64: removed
      MD5: 2ef61d694dbcb3b3d0f47f1bbc0ca831
      Size: 90.7 MB
      x86: removed
      MD5: 0f51f57cff0bf51aa368f90da1c8b525
      Size: 42.8
    • By niTe_RiDeR_Pr0
      SumatraPDF v3.2.10638 (Pre-Release) PDF Reader - Dual x86/x64 2-in-1 RePack
      About RePack (info):
      RePacks made by extracting the individual x86 & x64 installers available here & repacking them into an Inno setup. Nothing extra is added. Added choice to associate SumatraPDF with various file formats. Optional Command-Line Switches:
      File Details:
      File Name: SumatraPDF_3.2.10638.Dual_RePack.exe
      File Name: 6.17 MB
      MD5 Hash: C629DD40ACC6613BAB5B6F7FACE99AC4
      Screenshots are the top of the thread
    • By niTe_RiDeR_Pr0
      VidCoder v2.51 - Dual x86/x64 - 2-in-1 Compressed RePack
      About RePack (info):
      Multilanguage Installer. Installs 32/64bit version according to system architecture automatically. VidCoder requires .NET Framework 4.0. This RePack checks if .NET Framework 4.0 is installed in the system, and if it is not found, then it prompts the user to download and install automatically (within the installer). Compressed installer size from 24MB (size of 32+64bit installer) to 17MB. Optional Command-Line Switches:
      File Details:
      File Name: VidCoder_2.51_x86-x64_RePack.exe
      File Name: 17.9 MB
      MD5 Hash: 50D3F051BC2B7CA1E1C53448F523E02C
      Screenshots are at the top of this thread
    • By niTe_RiDeR_Pr0
      IrfanView v4.4.4 - x86/x64 + Plugins + Toolbars + Languages - 5-in-1 RePack
      About RePack (info):
      Multilanguage installer.   Installer contains: IrfanView-x86 files, IrfanView-x64 files, all plugins, all languages & 21 toolbar skins. Added IrfanPaint 3rd party plugin and Shell Extensions Installer installs x86/x64 version according to your Windows architecture. Optional Command-Line Switches:
       
      File Details:
      File Name: IrfanView_4.4.4.Dual_RePack.exe
      File Name: 30.2 MB
      MD5 Hash: B6D1ACB40002CCB6ACF5D115A92D14EC
      Screenshots are at the top of this thread
    • By niTe_RiDeR_Pr0
      IrfanView v4.4.4 - x86/x64 + Plugins + Toolbars + Languages - 5-in-1 RePack
      About RePack (info):
      Multilanguage installer.   Installer contains: IrfanView-x86 files, IrfanView-x64 files, all plugins, all languages & 21 toolbar skins. Added IrfanPaint 3rd party plugin and Shell Extensions Installer installs x86/x64 version according to your Windows architecture. Optional Command-Line Switches:

      Download: https://drive.google.com/uc?export=download&id=0BxE7TpGda882SmNOaTRpMS0xbHM
      File Name: IrfanView_4.4.4.Dual_RePack.exe
      File Name: 30.2 MB
      MD5 Hash: B6D1ACB40002CCB6ACF5D115A92D14EC
      Alternative Download Link: https://www.wincert.net/forum/index.php?/files/file/50-irfanview-v444-repack-x86x64pluginstoolbarslanguages-5-in-1/
       





       
×
×
  • Create New...