Carbon Posted November 26, 2013 Share Posted November 26, 2013 I am attempting to modify a registry value in a Java install script which installs Java silently and also modifies the registry. The registry change disables the update feature in Java. Orig: [HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava UpdatePolicy] "EnableJavaUpdate"=dword:00000001 Modified [HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava UpdatePolicy] "EnableJavaUpdate"=dword:00000000 When I run the following line I get a return of zero and the registry is not modified: RegWrite ("HKEY_LOCAL_MACHINESOFTWAREJavaSoftJava UpdatePolicy", "EnableJavaUpdate", 00000000) Can anyone help? Any suggestions would be very much appreciated. Thanks, Carbon Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2013 Developers Share Posted November 26, 2013 Are you running on an x64 os and running the x86 version of autoit3? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Carbon Posted November 26, 2013 Author Share Posted November 26, 2013 I am currently running Win7 32 bit and the x86 version of autoit3. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2013 Developers Share Posted November 26, 2013 Are you running in admin mode? Try adding #requireadmin at the top of your script. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Carbon Posted November 26, 2013 Author Share Posted November 26, 2013 I've tried that and I am still getting the same result. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2013 Developers Share Posted November 26, 2013 You are also missing the Type you are trying to write. Check the helpfile for the proper syntax. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Carbon Posted November 26, 2013 Author Share Posted November 26, 2013 Even when I add "REG_DWORD" to the line as the type I get the same result. I really should have put everything I tried in the first post as I am going to run out of posts for the day soon. I've been scouring the forums for a good part of the day attempting different things and no matter what I try I just can't get it to modify the registry. I really appreciate you taking the time to help me. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2013 Developers Share Posted November 26, 2013 Post what you have now and I will have a test with it. You should be in the normal members now so the 5 posts limit is lifted. Jos Carbon 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Carbon Posted November 26, 2013 Author Share Posted November 26, 2013 You know what, this is really weird, I rebooted and it seems to be working fine now. I wonder why a reboot would have mattered at all. The script works either way now with both 00000000 & 00000001 in that line. Link to comment Share on other sites More sharing options...
Carbon Posted November 26, 2013 Author Share Posted November 26, 2013 I've been messing with this all day and all I needed was a reboot. Come on. Link to comment Share on other sites More sharing options...
Carbon Posted November 26, 2013 Author Share Posted November 26, 2013 Here is the script: I know it's basic, please don't laugh. #requireadmin ;EnvSet gets rid of Security Warning Popup EnvSet ("SEE_MASK_NOZONECHECKS","1") ShellExecute ( "\\svritsnas3\BARRACUDA\java\Java 7.7 Silent Install" ) EnvSet ("SEE_MASK_NOZONECHECKS","0") ;Checks whether to apply 64bit or 32bit Java Update Kill reg fix $WinVer_Check = MsgBox (4, "Java Installer", "Is this a Windows 7 32-bit Machine?") If $WinVer_Check == 6 Then RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy", "EnableJavaUpdate", "REG_DWORD", 00000000) ElseIf $WinVer_Check == 7 Then RegWrite ("HKEY_LOCAL_MACHINE64\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy", "EnableJavaUpdate", "REG_DWORD", 00000000) EndIf Link to comment Share on other sites More sharing options...
Developers Jos Posted November 26, 2013 Developers Share Posted November 26, 2013 (edited) The last regwrite is wrong, but the first one should work. Try this code and post the result in case you still have issues: #requireadmin If @OSArch = "X86" Then $rc = RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy", "EnableJavaUpdate", "REG_DWORD", 00000000) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ElseIf @OSArch = "X64" Then $rc = RegWrite ("HKEY_LOCAL_MACHINE64\SOFTWARE\JavaSoft\Java Update\Policy", "EnableJavaUpdate", "REG_DWORD", 00000000) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Else ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Other OSARCH????: ' & @OSArch & @CRLF) ;### Debug Console EndIf Edited November 26, 2013 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Carbon Posted November 26, 2013 Author Share Posted November 26, 2013 Worked perfectly on X86 and thank you for getting rid of that needless MsgBox. Can I use those ConsoleWrite lines to debug any script? Also, in order to send them to a MsgBox would I have to create another line to print the error varable to a message box? Oh and you said the last regwrite wouldn't work? Is that because of the 64 at the end of HKLM? I thought I read that right in the help file as the proper syntax. Link to comment Share on other sites More sharing options...
Developers Jos Posted November 27, 2013 Developers Share Posted November 27, 2013 (edited) Worked perfectly on X86 and thank you for getting rid of that needless MsgBox. Can I use those ConsoleWrite lines to debug any script? Also, in order to send them to a MsgBox would I have to create another line to print the error varable to a message box? Oh and you said the last regwrite wouldn't work? Is that because of the 64 at the end of HKLM? I thought I read that right in the help file as the proper syntax. The Consolewrite(s) are shown when you press F5 in SciTE. This way it is easy to debug without annoying MsgBoxes. Your Last RegWrite had an error since you had both 64 at the end of the Hivename and Wow6432node in the key path: RegWrite ("HKEY_LOCAL_MACHINE64SOFTWAREWow6432NodeJavaSoftJava UpdatePolicy", "EnableJavaUpdate", "REG_DWORD", 00000000) Mine looks different. Jos Edited November 27, 2013 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Carbon Posted November 27, 2013 Author Share Posted November 27, 2013 Gotcha. Well I tested it on a Win7 32-bit & 64-bit machine and it seems to work flawlessly. Thanks so much for your help Jos! 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