Код:
; Java SE Runtime Environiment 1.6.0_10
$InstallPath=@ProgramFilesDir & "\Java\"
RegRead("HKLM\Software\JavaSoft\Java Runtime Environment", "CurrentVersion")
If @error <> 1 Then Exit
If FileExists($InstallPath) Then Exit
Blockinput(1)
Run("jre-6u10-windows-i586-p.exe")
WinWaitActive("Java Setup - Welcome", "Welcome to Java")
Sleep(300)
ControlClick("Java Setup - Welcome", "Welcome to Java", "[Class:Button; Instance:4]", "left", 1, 5, 10)
ControlClick("Java Setup - Welcome", "Welcome to Java", "[Class:Button; Instance:2]", "left", 1, 44, 11)
Sleep(1000)
ControlClick("Java Setup - Destination Folder", "Destination Folder", "[Class:Button; Instance:2]", "left", 1, 44, 11)
Send("{DELETE 64}")
Sleep(300)
Send($InstallPath)
Sleep(300)
ControlClick("Java Setup", "Change Current Destination Folder", "[Class:Button; Instance:1]", "left", 1, 44, 11)
Sleep(300)
ControlClick("Java Setup - Destination Folder", "Destination Folder", "[Class:Button; Instance:1]", "left", 1, 44, 11)
WinWaitActive("Java Setup - Complete", "You have Successfully Installed Java")
ControlClick("Java Setup - Complete", "You have Successfully Installed Java", "[Class:Button; Instance:1]", "left", 1, 44, 11)
Blockinput(0)
ShellExecute($InstallPath & "bin\jqs.exe", "-unregister", $InstallPath & "bin", "", @SW_HIDE)
; Regs
RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "SunJavaUpdateSched")
RegDelete("HKLM\Software\Microsoft\Windows\CurrentVersion\Run", "SunJavaUpdateSched")
;
RegWrite("HKLM\Software\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Java", "", "REG_SZ", "&Java")
RegWrite("HKLM\Software\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Java\command", "", "REG_SZ", @SystemDir & "\control.exe javacpl.cpl,,0")
;
RegWrite("HKCU\Software\JavaSoft\Java Update\Policy", "EnableAutoUpdateCheck", "REG_BINARY", "01000000d08c9ddf0115d1118c7a00c04fc297eb010000001975f2a9e936824fbc0ae15fc6a0d0f9000000001c000000500061007300730077006f007200640020004400610074006100000003660000a80000001000000023420b3c7a97e50631cd5f44afd32f400000000004800000a000000010000000711d7f0e77fac732fe0ed2c59b2c680108000000ff169463b94fbf2814000000670e9ec32122af4f7d419ad2f3aef3358defc6b9")
RegWrite("HKLM\Software\JavaSoft\Java Plug-in\1.6.0_10", "HideSystemTrayIcon", "REG_DWORD", "00000001")
RegWrite("HKLM\Software\JavaSoft\Java Plug-in\1.6.0_10", "UseJava2IExplorer", "REG_DWORD", "00000000")
RegWrite("HKLM\Software\JavaSoft\Java Plug-in\1.6.0_10", "UseNewJavaPlugin", "REG_DWORD", "00000000")
RegWrite("HKLM\Software\JavaSoft\Java Update\Policy", "EnableJavaUpdate", "REG_DWORD", "00000000")
; Links
FileCreateShortcut(@SystemDir & "\control.exe", @UserProfileDir & "\SendTo\Config\Java.lnk", @SystemDir, "javacpl.cpl,,0", "Java", $InstallPath & "bin\java.exe", "", 0, @SW_SHOWNORMAL)
FileCreateShortcut(@SystemDir & "\control.exe", @ProgramsDir & "\Config\Java.lnk", @SystemDir, "javacpl.cpl,,0", "Java", $InstallPath & "bin\java.exe", "", 0, @SW_SHOWNORMAL)
;
FileSetAttrib($InstallPath & "COPYRIGHT", "-R")
FileSetAttrib($InstallPath & "LICENSE", "-R")
FileSetAttrib($InstallPath & "LICENSE.rtf", "-R")
FileSetAttrib($InstallPath & "LICENSE_de.rtf", "-R")
FileSetAttrib($InstallPath & "LICENSE_es.rtf", "-R")
FileSetAttrib($InstallPath & "LICENSE_fr.rtf", "-R")
FileSetAttrib($InstallPath & "LICENSE_it.rtf", "-R")
FileSetAttrib($InstallPath & "LICENSE_ja.rtf", "-R")
FileSetAttrib($InstallPath & "LICENSE_ko.rtf", "-R")
FileSetAttrib($InstallPath & "LICENSE_sv.rtf", "-R")
FileSetAttrib($InstallPath & "LICENSE_zh_CN.rtf", "-R")
FileSetAttrib($InstallPath & "LICENSE_zh_TW.rtf", "-R")
FileSetAttrib($InstallPath & "README.txt", "-R")
FileSetAttrib($InstallPath & "THIRDPARTYLICENSEREADME.txt", "-R")
FileSetAttrib($InstallPath & "Welcome.html", "-R")
;
FileDelete($InstallPath & "COPYRIGHT")
FileDelete($InstallPath & "LICENSE")
FileDelete($InstallPath & "LICENSE.rtf")
FileDelete($InstallPath & "LICENSE_de.rtf")
FileDelete($InstallPath & "LICENSE_es.rtf")
FileDelete($InstallPath & "LICENSE_fr.rtf")
FileDelete($InstallPath & "LICENSE_it.rtf")
FileDelete($InstallPath & "LICENSE_ja.rtf")
FileDelete($InstallPath & "LICENSE_ko.rtf")
FileDelete($InstallPath & "LICENSE_sv.rtf")
FileDelete($InstallPath & "LICENSE_zh_CN.rtf")
FileDelete($InstallPath & "LICENSE_zh_TW.rtf")
FileDelete($InstallPath & "README.txt")
FileDelete($InstallPath & "THIRDPARTYLICENSEREADME.txt")
FileDelete($InstallPath & "Welcome.html")
;
FileDelete(@AppDataDir & "\Sun\Java\Deployment\deployment.properties")
;
$file = FileOpen(@AppDataDir & "\Sun\Java\Deployment\deployment.properties", 10)
FileWrite($file, "deployment.browser.path=" & @CRLF)
FileWrite($file, "deployment.browser.vm.iexplorer=false" & @CRLF)
FileWrite($file, "deployment.cache.enabled=false" & @CRLF)
FileWrite($file, "deployment.cache.max.size=1" & @CRLF)
FileWrite($file, "deployment.console.startup.mode=disable" & @CRLF)
FileWrite($file, "deployment.javaws.associations=never" & @CRLF)
FileWrite($file, "deployment.javaws.autodownload=never" & @CRLF)
FileWrite($file, "deployment.javaws.cache.update=false" & @CRLF)
FileWrite($file, "deployment.javaws.shortcut=never" & @CRLF)
FileWrite($file, "deployment.system.tray.icon=false" & @CRLF)
FileWrite($file, "deployment.version=6.0" & @CRLF)
FileClose($file)
;
FileSetAttrib($InstallPath, "+R")
$file = FileOpen($InstallPath & "desktop.ini", 10)
FileWrite($file, "[.ShellClassInfo]" & @CRLF)
FileWrite($file, "IconFile=bin\java.exe" & @CRLF)
FileWrite($file, "IconIndex=0" & @CRLF)
FileClose($file)