Jump to content

Java Upgrade


Recommended Posts

Thank you for responding,

I have hit a wall and it seems so simple, but I just can't get it. I have to run a Java update. The script needs to look in the registry, see version 7.x and then do something. If the RegRead returns a value of 1.7.0_15 then stop.

If RegRead returns any other version 7, then continue on and run the install. Everything else in my code is working fine, except being able to identify the product code and do the next thing: Close or install.

Here is part of my code:

#RequireAdmin
Local $a = "C:\Windows\Temp\"
Dim $var2 = "1.7.0_15"
Local $b = "C:\Users\"
Local $Sun = "C:\Users\" & @UserName & "\AppData\LocalLow\Sun\Java\Deployment\"
Local $Sun2 = "C:\Users\" & @UserName & "\AppData\LocalLow\Sun\Java\Deployment\security\"
Local $Sun3 = "C:\Users\" & @UserName & "\AppData\LocalLow\Sun\Java\Deployment\tmp\si"

;File copy section: Each Application is taken from the source and copied to the folders created

;If $a = True Then FileInstall("E:\JAVA\JRE7_15\jre-7u15-windows-i586.exe", "C:\Windows\Temp\jre-7u15-windows-i586.exe")

;Sleep(5000)
;Registry lookup for Java installation
Local $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\", "Java7FamilyVersion")
Sleep(5000)
If $var = $var2 Then
MsgBox(4096, "I see It:", $var)
EndIf
Else
If Not $var2 = $var Then
MsgBox(4096, "It Ain't Here:", $var)

  RunWait(@WindowsDir & "\Temp\jre-7u15-windows-i586.exe /s")
  Sleep(10000)
;MsgBox(4096, "I see It:", $var)

EndIf

everything below this works fine and the install file works fine as well. I placed message boxes in the code so I could track the code and they will be removed later. Any ideas would be great.

Cheers

Link to comment
Share on other sites

Are you running on x86 arch or x64?

I ask because x64 regread()'s need to be done as HKLM64 and not HKLM

EDIT:

Also, print out the @error flag after the regread...

IF @error Then consolewrite("Error " & @error & " found!" & @LF)

Edited by Colyn1337
Link to comment
Share on other sites

Tested and working well:

#RequireAdmin
Local $a = "C:\Windows\Temp\"
Dim $var2 = "1.7.0_17"
Local $b = "C:\Users\"
Local $Sun = "C:\Users\" & @UserName & "\AppData\LocalLow\Sun\Java\Deployment\"
Local $Sun2 = "C:\Users\" & @UserName & "\AppData\LocalLow\Sun\Java\Deployment\security\"
Local $Sun3 = "C:\Users\" & @UserName & "\AppData\LocalLow\Sun\Java\Deployment\tmp\si"

;File copy section: Each Application is taken from the source and copied to the folders created

;If $a = True Then FileInstall("E:\JAVA\JRE7_15\jre-7u15-windows-i586.exe", "C:\Windows\Temp\jre-7u15-windows-i586.exe")

;Sleep(5000)
;Registry lookup for Java installation
Local $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\", "Java7FamilyVersion")
MsgBox(0, "", $var)
Sleep(5000)
If $var = $var2 Then
MsgBox(4096, "I see It:", $var)
Else
MsgBox(4096, "It Ain't Here:", $var)

RunWait(@WindowsDir & "\Temp\jre-7u15-windows-i586.exe /s")
Sleep(10000)
EndIf

Hi!

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Link to comment
Share on other sites

Glad to help you, no problem :)

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

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

×
×
  • Create New...