Nursultan Posted February 13, 2017 Share Posted February 13, 2017 I am doing auto installer to java. But it does not work correctly. What wrong? expandcollapse popup#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 More sharing options...
ur Posted February 13, 2017 Share Posted February 13, 2017 What is the error you are getting when you run it or where is exactly the window events stop sending keys? Link to comment Share on other sites More sharing options...
Subz Posted February 13, 2017 Share Posted February 13, 2017 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). Starf0x 1 Link to comment Share on other sites More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 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 More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 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 More sharing options...
Subz Posted February 14, 2017 Share Posted February 14, 2017 Did you try my code, this installs Java Runtime with its own switches no need to wait for the Windows. Link to comment Share on other sites More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 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? Link to comment Share on other sites More sharing options...
Subz Posted February 14, 2017 Share Posted February 14, 2017 Correct Link to comment Share on other sites More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 6 minutes ago, Subz said: Correct It does not work, can you download from java.com java and run it? Link to comment Share on other sites More sharing options...
Subz Posted February 14, 2017 Share Posted February 14, 2017 (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 February 14, 2017 by Subz Link to comment Share on other sites More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 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 More sharing options...
Subz Posted February 14, 2017 Share Posted February 14, 2017 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 More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 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 More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 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 More sharing options...
Subz Posted February 14, 2017 Share Posted February 14, 2017 You could just place a MsgBox at the end of the code with a timer or not: MsgBox(0, 'Java Runtime', 'Completed', 10) Link to comment Share on other sites More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 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? Link to comment Share on other sites More sharing options...
Subz Posted February 14, 2017 Share Posted February 14, 2017 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. Link to comment Share on other sites More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 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() Link to comment Share on other sites More sharing options...
Subz Posted February 14, 2017 Share Posted February 14, 2017 #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 More sharing options...
Nursultan Posted February 14, 2017 Author Share Posted February 14, 2017 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now