Sign in to follow this  
Followers 0
RBrown1375

Java Upgrade

7 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Sorry I did leave that out. This will target x86 systems only Win 7 and XP.

I'll try your error code.

Edited by RBrown1375

Share this post


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

Share this post


Link to post
Share on other sites

Thank You for the response. I'll work on this now and let you know. :thumbsup:

Share this post


Link to post
Share on other sites

Nessie,

Your script additions worked great. Thank you!!!!

Cheers :geek:

Share this post


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

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • AppSoftwareVld
      By AppSoftwareVld
      Hello,
       
      I need this for a project and I don't find a method for the next problem.
      I want when I click a button to create a variable ("$variable1") so if I press one more time to create one more ("$variable2") and create more and more how many times you press the button.
       
      Do you have an idea ? 
      Thank you for your attention !
    • Jefrey
      By Jefrey
      I've ported these two functions from PHP to AU3 to work with URLs.
      Made them for those who work with libraries like HTTP.au3 (not the one I coded), that needs passing the server domain, path, etc., instead of the full URL.
      Grab the lib here.
      ParseURL( $sURL )
      Parses the URL and splits it into defined parts. Returns an array:
      [0] = Full URL (same as $sURL) [1] = Protocol (i.e.: http, https, ftp, ws...) [2] = Domain [3] = Port (or null if not specified) [4] = Path (or null if not specified) [5] = Query string (everything after the ? - or null if not specified) Example:
      $aExample = ParseURL("https://google.com:8080/?name=doe") MsgBox(0, "Test", "URL: " & $aExample[0] & @CRLF & _ "Protocol: " & $aExample[1] & @CRLF & _ "Domain: " & $aExample[2] & @CRLF & _ "Port: " & $aExample[3] & @CRLF & _ "Path: " & $aExample[4] & @CRLF & _ "Query string: " & $aExample[5])  
      ParseStr( $sStr )
      Parses a query string (similar to the [5] of the previous function) and returns a multidimensional array, where:
      [0][0] = number of variables found [0][1] = ununsed [1][0] = key name of the first variable [1][1] = first variable value (already URL decoded) [n][0] = key name of the nth variable [n][1] = nth variable value (already URL decoded) Example:
      include <Array.au3> ; need only to do _ArrayDisplay, not needed by the lib _ArrayDisplay(ParseStr("foo=bar&test=lol%20123")) #cs Result is: [0][0] = 2 [0][1] = ununsed [1][0] = foo [1][1] = bar [2][0] = test [2][1] = lol 123 #ce Feel free to fork!
    • CurtimusPrime
      By CurtimusPrime
      #include <Date.au3> #include <TrayConstants.au3> HotKeySet("^d", "WhatIsToday") Global $Today = _Date_Time_GetSystemTime While 1 Sleep(100) WEnd Func WhatIsToday() TrayTip("Today's date", "Today is... " & $Today, 8) Sleep(8000) TrayTip("", "", 0) EndFunc ;==>WhatIsToday all it outputs into tray bubble is:  Today is...
      without getting the system time as text
    • TheDcoder
      By TheDcoder
      I just thought of this... Do Constants and Variables have any differences other than Constants cannot be changed? I know that Python does not have such things like Constants... But is there a difference between them? any advantages when using Constants whenever we can?
      The uses of Constants which I have discovered so far are:
      Coding practices (You know what things are not supposed to be changed while the program is running). Preventing code from modifying their value. So, is there anything more than what meets the eye? I think the developers of AutoIt can answer this question.
    • Reizvoller
      By Reizvoller
      Hello!
      So I have a little script here 
      Func getThe () Local $nearPix = 0123 Local $winPos = WinGetPos ($workWin) FFSaveBMP ("yBarPosArea", "True" , 600, 239, 600, 555, 30, $workWin) $nearPix = FFNearestPixel (600, 220, "0xC1C1C1" , False, $workWin) If $nearPix == 0123 Then ConsoleWrite ("No val for NearPix") ElseIf $nearPix <> 0123 Then ConsoleWrite ("Val is there") ConsoleWrite ($nearPix[0]&","&$nearPix[1]&@CR) EndIf EndFunc And when it comes time to run it I get a return of 
      When it says "non-accessible variable" , what is it meaning by that? The scope is "Local" and it is within the same function. The variable was even referenced in the step right before the one throwing the error. Any insight would be thoroughly appreciated. Thank you!