Jump to content

I need your help


 Share

Recommended Posts

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

 

Link to comment
Share on other sites

  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?  

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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()?

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

  • Recently Browsing   0 members

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