Jump to content

Recommended Posts

Posted

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

 

  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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

Posted

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

Posted
  On 2/13/2017 at 12:36 PM, 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).

Expand  

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

Posted
  On 2/13/2017 at 12:09 PM, ur said:

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

Expand  

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

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
Posted
  On 2/14/2017 at 7:14 AM, 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?

Expand  
#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)

 

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)

 

Posted
  On 2/14/2017 at 7:21 AM, 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)

 

Expand  

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

Posted
  On 2/14/2017 at 7:21 AM, 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)

 

Expand  

can it notificate about finishing?  

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.

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)

 

Posted
  On 2/14/2017 at 8:02 AM, 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.

Expand  

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...