Jump to content

Java Multi Maker


mooms

Recommended Posts

Hello Thiersee, Happy New Year too !
 
1) You're right, I've updated the script (no version bump, it's very minor) you can replace it with this if that bothers you and don't want to redownload :

:NoJavaInstecho ================================================================================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 ================================================================================pausegoto :eof

2): Also reported by Escorpiom. That's not something I can fix.

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

 

Does this silent switch still apply to this? I'd like to make it silent installer, no progress bar visible.

Link to comment
Share on other sites

If you want a fully silent install (noGUI), you can use this code:
 


:CONFIGECHO ;!@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-2F[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp032.cfg"ECHO GUIMode="2">> "%~dp032.cfg"ECHO MiscFlags="4">> "%~dp032.cfg"ECHO RunProgram="%%DelOldVer%% /qn">> "%~dp032.cfg"ECHO RunProgram="jre_inst.msi /qn WEB_JAVA=0">> "%~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 WEB_JAVA=1">> "%~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 ;!@InstallEnd@!>> "%~dp032.cfg"ECHO. >> "%~dp032.cfg"GOTO :EOF:CONFIG_64ECHO ;!@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-2F[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp064.cfg"ECHO GUIMode="2">> "%~dp064.cfg"ECHO MiscFlags="4">> "%~dp064.cfg"ECHO RunProgram="x64:%%DelOldVer64%% /qn">> "%~dp064.cfg"ECHO RunProgram="x64:jre64_inst.msi /qn WEB_JAVA=0">> "%~dp064.cfg"ECHO AutoInstall="x64:%%DelOldVer64%% /qn">> "%~dp064.cfg"ECHO AutoInstall="x64:jre64_inst.msi /qn WEB_JAVA=1">> "%~dp064.cfg"ECHO ;!@InstallEnd@!>> "%~dp064.cfg"ECHO. >> "%~dp064.cfg"GOTO :EOF:CONFIG_AIOECHO ;!@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-2F[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-2F[0-9A-F]*}\"') Do MsiExec /x{%%a}">> "%~dp0AIO.cfg"ECHO GUIMode="2">> "%~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 /qn WEB_JAVA=0">> "%~dp0AIO.cfg"ECHO RunProgram="x64:jre64_inst.msi /qn WEB_JAVA=0">> "%~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 WEB_JAVA=1">> "%~dp0AIO.cfg"ECHO AutoInstall="x64:jre64_inst.msi /qn WEB_JAVA=1">> "%~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 ;!@InstallEnd@!>> "%~dp0AIO.cfg"ECHO. >> "%~dp0AIO.cfg"GOTO :EOF


 
Default install (no switch): no web plugins.
-ai switch: web plugins.

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?

 

 

 

@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

 

 

:please: :crying_anim02:  not work for me

make the file cmd and upload for me

please.

Link to comment
Share on other sites

Version 2.1

What's new:

 

- Now with LZMA2 compression (slightly better compression and less memory intensive)

- The maker will ask you if you want a GUI or NoGUI SFX

Hi Mooms,

 

the problem I had has gone, maybe my Java-installation was not OK; I uninstalled it, made the dual-installer, installed Java again and started the Multi Maker (2.1) again.

 

This time almost all OK, only one bug (or feature :D, or both):

it uninstall java from my system and does NOT install it again!

I must start the AIO on my own.

 

1 suggestion:

may be you put a title line in the questions (x86, x64 or both and Gui/no GUI) showing the version of the Multi Maker.

 

Thiersee

Edited by Thiersee
Link to comment
Share on other sites

version 2.2

Whats new:

- Added a title in the script (with version number)
- The 2 questions are now asked in the beginning, in a blue shell to get the attention
- Optimized the script




This time almost all OK, only one bug (or feature :D, or both):
it uninstall java from my system and does NOT install it again!
I must start the AIO on my own.


Sorry, can't reproduce it, try with v2.2 and report.

Link to comment
Share on other sites

There is a problem in the > 2.0 maker:

On my x64-machine the UAC-daemon is switched off / disabled, so the checking of "admin Rights" runs in an endless loop,
because the uac-daemon is not responding.

Can you enhance your checkscript, so it´s not depend on the presence of active uac directly ?

I have always admin-rights on my machine as User "Administrator" - so uac is normaly never needed for me ;-)
 

Link to comment
Share on other sites

@Himan:
The BatchGotAdmin code is not mine, but you can easily fix the script, just remove those lines in the beginning:
 

:: BatchGotAdmin::-------------------------------------REM  --> Check for permissions>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"REM --> If error flag set, we do not have admin.if '%errorlevel%' NEQ '0' (    echo Requesting administrative privileges...    goto UACPrompt) else ( goto gotAdmin ):UACPrompt    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"    "%temp%\getadmin.vbs"    exit /B:gotAdmin    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )    pushd "%CD%"    CD /D "%~dp0":--------------------------------------
Link to comment
Share on other sites

This time almost all OK, only one bug (or feature :D, or both):

it uninstall java from my system and does NOT install it again!

I must start the AIO on my own.

Sorry, can't reproduce it, try with v2.2 and report.

 

I can confirm it with 2.2 too!

I tested many times on my working machine (UAC disabled, account with admin-rights), then I tried it on a VM (VirtualBox) with UAC (standard): same problem.

 

I'll try now your hint to Himan and reports later.

 

Thiersee

 

Edit:

 

It does not work, neither without the code nor with the changed one :sad02:!

Edited by Thiersee
Link to comment
Share on other sites

@Thiersee: this code is only for checking if the batch have admin rights & re-launching it with them if not, hence the UAC prompt.

 

edit:

I see the problem now,  when the script launch the installers to extract the MSI, Java is also uninstalled !

Apparently it's a new feature starting from Java8u20....

 

Detect older versions (8u20 and later versions). Starting with Java 8 Update 20 (8u20), on Windows systems, the Java Uninstall Tool is integrated with the installer to provide an option to remove older versions of Java from the system. The change is applicable to 32 bit and 64 bit Windows platforms.

 

I don't understand why the uninstallation is automatically done, maybe because the previous install was an admin install ?

I will try to come with a fix....

Link to comment
Share on other sites

@Thiersee: this code is only for checking if the batch have admin rights & re-launching it with them if not, hence the UAC prompt.

 

edit:

I see the problem now,  when the script launch the installers to extract the MSI, Java is also uninstalled !

I will try to come with a fix....

I'm happy, NOT because of the fault, but because you saw it!

 

Thiersee

Link to comment
Share on other sites

Version 2.3 of the script is on the first post.
 
What's new:
 

- Major rewrite, update is very recommanded over previous 2.x versions
- No more need to launch the script as admin
- msi are now extracted with ResourcesExtract like in v1.x of the maker
- No more admin install point
- x64 & dual installers can now be created on x86 Windows (even XP)


After some researches, I've found a way to extract the x86 MSI with ResourcesExtract: the x86 setup is compressed with UPX, once uncompressed the MSi can be extracted without launching the setup first, like the old Java setup (x64 setup is not compressed with UPX).
 
Now the maker behave like in v1.x:
That eliminate the need to run the script as admin, and the bug with the auto uninstallation.
That means both issues mentioned by Himan and Thiersee are now fixed !
I've also found that creating an admin install point is not needed anymore.
Bonus: it is now possible to create the x64 & dual installers on x86 Windows.

Link to comment
Share on other sites

Hi Mooms,

 

very good job, it works now :beerchug:!

 

Just one question:

 

if the original java installers are already present, I get a warning (error?) from UPX, but the dual installer will be completed without issues:

 

not present (will be downloaded):

l99l5stxqig.jpg
 
already present:
p6nfyzcua4q4.jpg
Thanks a lot
 
Thiersee
Edited by Thiersee
Link to comment
Share on other sites

You can ignore it, it's purely informative.

It's because the setup was uncompressed by UPX the first time you ran the script.

Inevitably, the following times you launch the maker, you can read in red: NotPackedException: not packed by UPX ;)
 

Link to comment
Share on other sites

@stashmajcherc:
 
Previous versions have a bug: Java is uninstalled when the script launch the installer(s) to capture the MSI.
Version 2.3 is much better, read my previous posts.
 
Do you have tried to run the script in the root folder of one of your drive ?
Or simply from a folder with no space in its path ?
I'm fairly sure the error is caused by a space in the folder's path, as I've tried to explain :
 

C:\Program Files\JAVA-Multi_Maker - a space between Program & Files)
C:\progs\JAVA-Multi_Maker - no space


Do you understand now ?

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...