Nursultan

I need your help

83 posts in this topic

I am doing auto installer to java. But it does not work correctly. What wrong?

#RequireAdmin
#include <MsgBoxConstants.au3>


Run(@ScriptDir & '\JavaSetup8u121.exe')
AutoItSetOption('MouseCoordMode', 0)

;Java
WinWait('Java Setup - Welcome')
WinActivate('Java Setup - Welcome')
If WinExists ('Java Setup - Welcome') Then
   MouseClick('primary',435, 357, 1, 0)
EndIf
WinWait('Downloading Java Installer', 'Java is found everywhere - on mobile phones, desktop computers, Blu-ray Disc players, set top boxes, and even in your car.')
If WinExists ('Downloading Java Installer') Then
   Sleep(1000)
Else
   WinClose('Downloading Java Installer')
EndIf

WinWait('Java Setup')
If WinExists ('Java Setup') Then
   ControlCommand('Java Setup', '', 'Button4', 'UnCheck')
   MouseClick('primary',433, 365, 1, 0)
EndIf
;WinWait('Java Setup - Uninstall out-of-date versions', 5)
If WinExists ('Java Setup - Uninstall out-of-date versions') Then
   Sleep(200)
   WinClose('Java Setup - Uninstall out-of-date versions')
   ;Sleep(200)
   WinWait('Java Setup - Complete')
   WinActivate('Java Setup - Complete')
   MouseClick('primary',440, 358, 1, 0)
   WinWait('Java Setup - Complete')
   If WinExists ('Java Setup - Complete') Then
      Sleep(200)
      WinClose('Java Setup - Complete')
   EndIf
ElseIf
   WinActivate('Java Setup - Complete')
   WinClose('Java Setup - Complete')
EndIf

 

Share this post


Link to post
Share on other sites



What is the error you are getting when you run it or where is exactly the window events stop sending keys?

Share this post


Link to post
Share on other sites

Its generally better to use the installer with switches

For example:

;~ JREx64 - Install this for x64 systems only
If @OSArch = 'x64' Then
    RunWait(@ScriptDir & '\jre-xuxx-windows-x64.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)
EndIf
;~ JREx86 - Install this for both x86/x64 systems
RunWait(@ScriptDir & '\jre-xuxx-windows-i586.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)

If you want it to uninstall previous versions, just remove the Static=Enable switch then it will do a patch install (overwrites existing versions).

1 person likes this

Share this post


Link to post
Share on other sites
18 hours ago, Subz said:

Its generally better to use the installer with switches

For example:

;~ JREx64 - Install this for x64 systems only
If @OSArch = 'x64' Then
    RunWait(@ScriptDir & '\jre-xuxx-windows-x64.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)
EndIf
;~ JREx86 - Install this for both x86/x64 systems
RunWait(@ScriptDir & '\jre-xuxx-windows-i586.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)

If you want it to uninstall previous versions, just remove the Static=Enable switch then it will do a patch install (overwrites existing versions).

Installer should to check the windows title. if there title with uninstall, it should continue without uninstall. if install title it should continue install

Share this post


Link to post
Share on other sites
18 hours ago, ur said:

What is the error you are getting when you run it or where is exactly the window events stop sending keys?

Installer should to check the windows title. if there title with uninstall, it should continue without uninstall. if install title it should continue install

Share this post


Link to post
Share on other sites

Did you try my code, this installs Java Runtime with its own switches no need to wait for the Windows.

Share this post


Link to post
Share on other sites
2 minutes ago, Subz said:

Did you try my code, this installs Java Runtime with its own switches no need to wait for the Windows.

Your code is auto installer of Java?

 

Share this post


Link to post
Share on other sites

Correct

Share this post


Link to post
Share on other sites
6 minutes ago, Subz said:

Correct

It does not work, can you download from java.com java and run it?

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I used this a couple of weeks ago to deploy to 1500 systems so it should work, can you post the code you used?

Edited by Subz

Share this post


Link to post
Share on other sites

#11 ·  Posted

Just now, Subz said:

I use this a couple of weeks to deploy to 1500 systems so it should work, can you post the code you used?

#RequireAdmin

;~ JREx64 - Install this for x64 systems only
If @OSArch = 'x64' Then
    RunWait(@ScriptDir & '\JavaSetup8u121.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)
EndIf
;~ JREx86 - Install this for both x86/x64 systems
RunWait(@ScriptDir & '\JavaSetup8u121.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)

 

Share this post


Link to post
Share on other sites

#12 ·  Posted

Can you go here: https://java.com/en/download/manual.jsp and download both WIndows Offline + Windows Offline (64-bit), save to your script folder and then you should be able to use the following:

#RequireAdmin

;~ JREx64 - Install this for x64 systems only
If @OSArch = 'x64' Then
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) ;~ Turns On 64 Bit Redirection
        RunWait(@ScriptDir & '\jre-8u121-windows-x64.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0) ;~ Turns Off 64 Bit Redirection
EndIf
;~ JREx86 - Install this for both x86/x64 systems
RunWait(@ScriptDir & '\jre-8u121-windows-i586.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)

 

Share this post


Link to post
Share on other sites

#13 ·  Posted

16 minutes ago, Subz said:

Can you go here: https://java.com/en/download/manual.jsp and download both WIndows Offline + Windows Offline (64-bit), save to your script folder and then you should be able to use the following:

#RequireAdmin

;~ JREx64 - Install this for x64 systems only
If @OSArch = 'x64' Then
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) ;~ Turns On 64 Bit Redirection
        RunWait(@ScriptDir & '\jre-8u121-windows-x64.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0) ;~ Turns Off 64 Bit Redirection
EndIf
;~ JREx86 - Install this for both x86/x64 systems
RunWait(@ScriptDir & '\jre-8u121-windows-i586.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)

 

it will install automatically without showing (the process) any window, am I right?

Share this post


Link to post
Share on other sites

#14 ·  Posted

22 minutes ago, Subz said:

Can you go here: https://java.com/en/download/manual.jsp and download both WIndows Offline + Windows Offline (64-bit), save to your script folder and then you should be able to use the following:

#RequireAdmin

;~ JREx64 - Install this for x64 systems only
If @OSArch = 'x64' Then
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) ;~ Turns On 64 Bit Redirection
        RunWait(@ScriptDir & '\jre-8u121-windows-x64.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0) ;~ Turns Off 64 Bit Redirection
EndIf
;~ JREx86 - Install this for both x86/x64 systems
RunWait(@ScriptDir & '\jre-8u121-windows-i586.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)

 

can it notificate about finishing?  

Share this post


Link to post
Share on other sites

#15 ·  Posted

You could just place a MsgBox at the end of the code with a timer or not:

MsgBox(0, 'Java Runtime', 'Completed', 10)

 

Share this post


Link to post
Share on other sites

#16 ·  Posted

1 minute ago, Subz said:

You could just place a MsgBox at the end of the code with a timer or not:

MsgBox(0, 'Java Runtime', 'Completed', 10)

 

There installed 2 Java (java 8 update 121 (64-bit), java 8 update 121) why?

Share this post


Link to post
Share on other sites

#17 ·  Posted

It depends on usage, in our organisation for example, some users use 64 bit Java applications, however most browsers only use 32 bit Java so we install both, if you only want to install Java 32 bit then just remove the 64 bit code.

Share this post


Link to post
Share on other sites

#18 ·  Posted

4 minutes ago, Subz said:

You could just place a MsgBox at the end of the code with a timer or not:

MsgBox(0, 'Java Runtime', 'Completed', 10)

 

Please, Explain the code, what is DllCall for what it? and meaning in RunWait() 

Share this post


Link to post
Share on other sites

#19 ·  Posted

#RequireAdmin

;~ JREx64 - Install this for x64 systems only
If @OSArch = 'x64' Then
    ;~ Enables file system redirection for the calling thread.
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) ;~ Turns On 64 Bit Redirection
        ;~ Installs Java Runtime 64 bit
        RunWait(@ScriptDir & '\jre-8u121-windows-x64.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)
    ;~ Disables file system redirection from the calling thread
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0) ;~ Turns Off 64 Bit Redirection
EndIf

;~ JREx86 - Install this for both x86/x64 systems
RunWait(@ScriptDir & '\jre-8u121-windows-i586.exe INSTALL_SILENT=Enable STATIC=Enable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=Disable REBOOT=Disable NOSTARTMENU=Enable SPONSORS=Disable', '', @SW_HIDE)

;~ Complete Message Box, closes in 10 seconds
MsgBox(0, 'Java Runtime', 'Completed', 10)

 

Share this post


Link to post
Share on other sites

#20 ·  Posted

25 minutes ago, Subz said:

It depends on usage, in our organisation for example, some users use 64 bit Java applications, however most browsers only use 32 bit Java so we install both, if you only want to install Java 32 bit then just remove the 64 bit code.

What about other program, what should I to write in scope RunTime()?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now