Duke5A Posted March 12, 2012 Posted March 12, 2012 Ohh Java, how I loathe thee.... With every Java update comes sleepless nights and therapy sessions. Alright, Java 7u3 is out now and I need to push it down to staff machines to plug the giant gaping security holes it leaves. I've followed Oracle's little how-to that can be found here and have had success. The problem is, Java will uninstall any previous version that is in the same major revision number. So if I deploy Java 6u31 and a machine already has 6u17 it'll remove it, but if I push 7u3 and there is a previous install of 6u30 it'll leave it. This is what I've observed, and it makes sense to remove older versions, but most of the time when it's pushed through Active Directory the uninstall goes up in smoke and leaves a broken install on the machine. This has happened countless times to me deploying both versions 6 and 7. Oddly enough, the push of 7u2 went without a hitch because almost everyone was running 6u30 on their machines, so Java didn't make an attempt to uninstall the previous version this time around. Now I'm back to deploying 7u3 and I'm worried it's going to break again. Has anyone else successfully pushed an MSI of Java through AD and lived to tell about it? I'm looking to get your observations on how successes and failures have played out. Thanks guys!
FN-GM Posted March 12, 2012 Posted March 12, 2012 The only time i have got it to work properly is using a VBS script to remove all old versions and do a nice clean install. Works every time. As a side note you shouldnt really be used version 7 in production yet.
Duke5A Posted March 12, 2012 Author Posted March 12, 2012 The only time i have got it to work properly is using a VBS script to remove all old versions and do a nice clean install. Works every time. As a side note you shouldnt really be used version 7 in production yet. Can you point me in the direction of said script? Your absolutely right, I jumped the gun on Java 7. I waited until 7u2 was out but I should have waited longer. Oracle doesn't even have it up on Java.com yet, but I never went there for updated versions as they all come with whatever flavor of month toolbar they have. The downloads on Java SE Downloads don't have that junk. I guess I never saw the notice because of this.
FN-GM Posted March 12, 2012 Posted March 12, 2012 I use this batch file to check to see if Java is installed. If not strip out all other versions and install the current version. It used a VBS script to remove them. if exist "C:\Software-Deployment-Logs\Java-6-Update30-x86.log" goto :EOF cscript /B /nologo "\\server\share\Remove-Java.vbs" /keeponly "\\server\share\jre1.6.0_30.msi" /quiet /log C:\Software-Deployment-Logs\Java-6-Update30-x86.log :EOF If you PM me your e-mail i will send the VBS script. I cant upload attachments for some reason and the character limit has been exceed 2
Davit2005 Posted March 14, 2012 Posted March 14, 2012 I use this batch file to check to see if Java is installed. If not strip out all other versions and install the current version. It used a VBS script to remove them. if exist "C:\Software-Deployment-Logs\Java-6-Update30-x86.log" goto :EOF cscript /B /nologo "\\server\share\Remove-Java.vbs" /keeponly "\\server\share\jre1.6.0_30.msi" /quiet /log C:\Software-Deployment-Logs\Java-6-Update30-x86.log :EOF If you PM me your e-mail i will send the VBS script. I cant upload attachments for some reason and the character limit has been exceed Permission to PM you for vbs code also :-D ?
FN-GM Posted March 14, 2012 Posted March 14, 2012 Permission to PM you for vbs code also :-D ? ^^^ look up at post 6 ^^^ 1
Duke5A Posted March 14, 2012 Author Posted March 14, 2012 Awesome! I made the appropriate changes to the batch file and it uninstalled the previous Java version and dropped in the new one. Only thing to watch for is if you're running it for the first time msiexec won't create the Software-Deployment-Logs directory. If the folder that you want the log to show up in is not there, msiexec will simply quit without so much as even an explanation why in the event log. @FN-GM You rock. I can only imagine how much time it took to write and debug that script. Thanks again...
FN-GM Posted March 14, 2012 Posted March 14, 2012 @Duke5A your welcome, but i cant take the credit for that script. It came from someone at Microsoft. Software-Deployment-Logs is a custom directory on our LAN. Do you need some code for a batch file to create it.
Duke5A Posted March 15, 2012 Author Posted March 15, 2012 @Duke5A Do you need some code for a batch file to create it. I'm good in that regard. Just noting some goofy behavior from msiexec. One last question though, when you push this out do you just set the batch file as a start up script in GPO?
FN-GM Posted March 15, 2012 Posted March 15, 2012 when you push this out do you just set the batch file as a start up script in GPO? We do yes. 1
rslulz Posted March 26, 2012 Posted March 26, 2012 Please find the attached script Awesome idea! My jre gpo is giving me a hard time right now, but glad I ran across this.
Duke5A Posted April 10, 2012 Author Posted April 10, 2012 (edited) Awesome idea! My jre gpo is giving me a hard time right now, but glad I ran across this. It works great. It still blows my mind that this problem that has been hanging around since at least Java 6u17 hasn't been fixed yet. I guess I shouldn't expect much seeing as how Java still stores a ton of it's settings in a flat file in the user's profile directory. It would be nice if they pushed all of its settings back into the registry, fixed the installer, and gave us ADM templates to manage it. But I digress... Another issue I've seen is the installer doesn't register the file association correctly for .JNLP files. I've had users complaining of Java not properly launching when trying to pull up Java apps through a we browser. Well, this is why. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.jnlp] @="JNLPFile" "Content Type"="application/x-java-jnlp-file" [HKEY_CLASSES_ROOT\JNLPFile] @="JNLP File" "EditFlags"=hex:00,00,01,00 [HKEY_CLASSES_ROOT\JNLPFile\Shell] [HKEY_CLASSES_ROOT\JNLPFile\Shell\Open] @="&Launch" [HKEY_CLASSES_ROOT\JNLPFile\Shell\Open\Command] @="\"C:\\Windows\\system32\\javaws.exe\" \"%1\"" Rolling this reg export up into the end of the batch script that FN-GM provided will fix this issue. This export was for 32-bit Java. I don't know if there is a difference for the 64. Edited April 10, 2012 by Duke5A 1
mattdowding Posted April 11, 2012 Posted April 11, 2012 I seek advice from the great hive mind of edugeek :-) on the same kind of issue. As it's easter I decided to give our IT rooms an overhaul and tidy up some of the computers a bit, I've discovered that about 10 of them are still running update 14 of the java, so I thought 'oh lets get these computers upgraded to the right version as AD doesn't seem to be deploying the java update to them' little did i know it would turn into a nightmare for me. basically I have hit a snag where i physically cannot get the update 14 of java to remove itself from my sight, it refuses to update, it refuses to uninstall, i even tried getting my hands on a .msi of the 14 update, but it still refuses, i keep getting the cannot find the msi on network error, as it was hosted on an old server before I started (which is why i went hunting for the 14 update msi, but it just errors saying it's not valid) I've even tried FN-GM's script from above, and java just refuses to budge! Any suggestions (or even pointing out blind stupid mistakes i've made here) would be much appreated.
themightymrp Posted April 11, 2012 Posted April 11, 2012 As it was installed from an old server there is probably a registry key somewhere which is pointing to the old deployment share for that MSI. Try searching the reg on one of the machines for the name of the update 14 msi file. If you find a key with a path to the old server, try changing it to point to a current share and pop the update 14 msi into that folder. When you try uninstalling it should find the file correctly. If this works you just need to add a reg modify line into a batch file (or GPP) before running the uninstall
Jollity Posted April 15, 2012 Posted April 15, 2012 Last time we deployed Java, I did it by extracting the MSI out of the installer and deploying that. It worked initially, but whenever Windows decided it needed to re-install or repair the install on Windows 7 or Vista the install would break completely - most of Java's files would be removed and a file core.zip left in the folder, stored in the zip file were all the files. These re-installs occurred when moving computers between OUs with different group policies deploying MSI, but apparently occurred at other times as well. The root cause of the problem is that the Java MSI is not installing the files properly though the file table. It installs the core.zip file and then runs a custom action to extract the files out. This works for install, but means that during repair/reinstall Windows Installer carefully restores core.zip rather than the actual files. Flash MSIs do a similar thing, and it also causes problems. I am just about to deploy Java again. I might try FN-GM's script this time.
Jollity Posted April 15, 2012 Posted April 15, 2012 I seek advice from the great hive mind of edugeek :-) on the same kind of issue. As it's easter I decided to give our IT rooms an overhaul and tidy up some of the computers a bit, I've discovered that about 10 of them are still running update 14 of the java, so I thought 'oh lets get these computers upgraded to the right version as AD doesn't seem to be deploying the java update to them' little did i know it would turn into a nightmare for me. basically I have hit a snag where i physically cannot get the update 14 of java to remove itself from my sight, it refuses to update, it refuses to uninstall, i even tried getting my hands on a .msi of the 14 update, but it still refuses, i keep getting the cannot find the msi on network error, as it was hosted on an old server before I started (which is why i went hunting for the 14 update msi, but it just errors saying it's not valid) I've even tried FN-GM's script from above, and java just refuses to budge! Any suggestions (or even pointing out blind stupid mistakes i've made here) would be much appreated. themightymrp's suggestion is probably safer if you can get it to work, but the tool I would use in these circumstances is the windows installer cleanup utility. It is a blunt instrument that will kill off all of Windows Installer's record of an installed MSI, though it leaves the files installed by that MSI and (I think) the program's registry settings unchanged. If you run that, then you should be able to reinstall Java update 14 again over the top and then uninstall it properly. I have found it really useful for dealing with these kinds of problems. Unfortunately Microsoft no longer provide the utility - they have released an alternative here that I have not tried, but might work for you. You can also obtain the original windows installer cleanup utility from various freeware sites.
Arthur Posted April 15, 2012 Posted April 15, 2012 I have hit a snag where I physically cannot get the update 14 of Java to remove itself from my sight, it refuses to update, it refuses to uninstall Try this trick to force the MSI to install over the top of an existing installation (even when it is messed up)... msiexec [b]/fvecmus[/b] "jre1.6.0_14.msi" /qb! Once you have done that, you can either uninstall 'Update 14' properly via Programs & Features or install the latest version of Java (the former option probably being the most reliable).
Arthur Posted April 15, 2012 Posted April 15, 2012 This works for install, but means that during repair/reinstall Windows Installer carefully restores core.zip rather than the actual files. This is a known bug with Java 6 Update 18 onwards, but Oracle have no intention of fixing their MSI because they do not see it as an issue. According to this thread on the IT Ninja website (see the posts by a user called Deranjer), the way to fix it is to modify the IntallMode for most of the files in the RemoveFile table so that they do not get deleted when the MSI is repaired/reinstalled. You can either use the MSI for Java 6 Update 17 as a reference for creating an MST for the latest Java MSI or alternatively download the one I have attached below for Update 31 (which also has a few additional modifications that you may/may not need).Oracle Java Runtime Environment 6 Update 31.7z 1
Jollity Posted April 16, 2012 Posted April 16, 2012 This is a known bug with Java 6 Update 18 onwards, but Oracle have no intention of fixing their MSI because they do not see it as an issue. That is a disappointing response from Oracle considering how easy it would be for them to fix at least reinstall. I do not understand why they are using an MSI at all if they do not intend to support it properly. What is so appealing about these bizarre MSI sandwiches with an exe installer, wrapped in a MSI, wrapped in another exe installer? I really appreciate your laying out the workaround. I will give your MST a try tomorrow. The person who submitted the bug report to Oracle says of the workaround: "However, using a transform in this manner would likely cause problems with future versions or Updates of Java." It seems to me that it ought not to cause a problem: future updates should still remove previous versions (of the same major version) even with the transform (at least as well as they ever did). Have you had any problems with this?
Arthur Posted April 16, 2012 Posted April 16, 2012 What is so appealing about these bizarre MSI sandwiches with an exe installer, wrapped in a MSI, wrapped in another exe installer? I have never understood the appeal either. Adobe and Google also do this and it is incredibly annoying. Perhaps bundling toolbars and other junk is easier when you use EXEs installers? Have you had any problems with this? I always fully uninstall the old MSI prior to installing the latest. This way the new MSI has no knowledge of what was installed before. 99% of the time this works perfectly. Based on the comment below, I reckon if you are upgrading from one minor Java version to another you shouldn't have any issues. deranjer | 07/16/2010 I was successfully able to update from the straight unedited 6u20 to the 6u21 msi with mst with no issues, everything appears to be working fine, which is good, saved me a lot of hassle. 1
sibasundar Posted June 21, 2012 Posted June 21, 2012 Please find the attached script @FN-GM --> Thanks for the script. the script is working on windows xp but not on windows 7. Can you please suggest on this.
FN-GM Posted June 21, 2012 Posted June 21, 2012 @FN-GM --> Thanks for the script. the script is working on windows xp but not on windows 7. Can you please suggest on this. Works for us, we only have Windows 7. What is the error?
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