27 Replies Latest reply on Feb 23, 2015 1:21 PM by frgpugs

    Java 7 to Java 8 Upgrade Package

    blashmet

      How do I release a package that upgrades systems with any version of Java 7 to the latest version of Java 8 (currently u20)?

       

      Is it sufficient to edit the applicability rules of the "Java Runtime Enviornment 8u20" packages that already exist in Patch Manager?  Will it uninstall the old 7 versions?

        • Re: Java 7 to Java 8 Upgrade Package
          jbaits

          I'd start by duplicating a base Java 8 install package and go from there. You will need to add applicability rules that detect Java 7 installs. You can look for a reg key (ex. HKLM\SOFTWARE\Javasoft\Java Runtime Environment\1.7) or to be sure it isn't just an erroneous key you can see if a file exists. Usually installs of a new Java major version do not remove the previous version. You could add a post install step in package boot to remove any existing installs of Java 7. I have an entry in package boot that launches cmd.exe with the following parameters "/c wmic product where "name like 'Java 7%%'" call uninstall /nointeractive".

            • Re: Java 7 to Java 8 Upgrade Package
              dfoli

              jbaits,

              That worked great for me, but I have some machines that have both x32 and x64 Java.  I would like to only uninstall the x32 with the x32 package and the x64 with the x64 package.  How could I adjust the parameters to accomplish that?

                • Re: Java 7 to Java 8 Upgrade Package
                  Lawrence Garvin

                  There should be separate ProductIDs for the x86 and x64 version. Just define the ProductID of the version you want to remove.

                    • Re: Java 7 to Java 8 Upgrade Package
                      jbaits

                      The problem with that approach is that it will not blanket uninstall any version of Java 7. The product codes for each update version would need to be included. A well crafted WMI call will eliminate all installed versions in one command.

                        • Re: Java 7 to Java 8 Upgrade Package
                          Lawrence Garvin

                          That may well be the case. But if that's how it is, that's how it is, and you'll have to account for those possibilties in your package declarations.

                           

                          OR... you could simply launch a Software Uninstall task from Computer Explorer -> Installed Software and target it to all the systems that need JRE7 uninstalled.

                           

                          NOTE ALSO.. JRE8 and JRE7 are designed to co-exist, so you do NOT have to uninstall JRE7 when you are installing JRE8!

                      • Re: Java 7 to Java 8 Upgrade Package
                        jbaits

                        This only gets tricky since there is no identifier for 32-bit installs in the product name. In my environment I have three Java packages; one for x86, one for x64, and one for x86 installs on x64 machines. The x86 package only applies to 32 bit machines and therefore the line I previously provided would work fine. For the x64 and x86 for x64 packages you would need the wmi query to make two checks. You need to name sure the product name starts with Java 7 and either ends or does not end with (64-bit) depending on the install you're targeting. The lines below should target appropriately.

                        Target 32 bit install: wmic product where "name like 'Java 7%%' AND NOT name like '%%(64-bit)'" call uninstall /nointeractive

                        Target 64 bit install: wmic product where "name like 'Java 7%%' AND name like '%%(64-bit)'" call uninstall /nointeractive

                          • Re: Java 7 to Java 8 Upgrade Package
                            Lawrence Garvin

                            The x86 and x86-on-x64 packages have identical binaries, thus identical ProductIDs.

                            The only difference between the packages is the metadata, allowing for the different deployment architectures.

                             

                            I fear you are trying to do complex things in the package that are better done through simple prerequisite rules. Here are the three scenarios that are possible:

                            Prerequisite rule in package checks for Processor Architecture = x86 and uninstallation ProductID = JRE7 x86 package. Uninstalls 32-bit JRE from 32-bit systems.

                            Prerequisite rule in package checks for Processor Architecture = x64 and uninstallation ProductID = JRE7 x64 package. Uninstalls 64-bit JRE from 64-bit systems.

                            Prerequisite rule in package checks for Processor Architecture = x64 and uninstallation ProductID = JRE7 x86 package. Uninstalls 32-bit JRE from 64-bit systems.

                              • Re: Java 7 to Java 8 Upgrade Package
                                jbaits

                                This is fine for a pure uninstall package if you know exactly which version is installed on every system and are sure that there are not multiple installs on each machine. The original question in this thread was how to create a package that will install Java 8 AND uninstall Java 7. Yes they can be installed side by side but removing versions not in use reduces your attack profile and removes the need to patch both versions in the future. The binaries are identical for all x86 installs but the poster I responded to wanted a way to have the 32 bit and 64 bit packages only remove the corresponding architecture of Java 7 which is what my response provides and also does not require adding new product codes in the future since Java 7 is still being patched.

                                  • Re: Java 7 to Java 8 Upgrade Package
                                    Lawrence Garvin

                                    So here's the simple solution.

                                    Patch JRE7 to the current version and then you only have one version to worry about uninstalling. :-)

                                     

                                    My point about installing side-by-side was to say that the JRE7 does NOT need to be uninstalled when installing JRE8. In fact, my personal take is that the uninstallation should NOT be coded into the update package at all. Right tool for the job is the mantra here.

                                    We provide an easy-to-use tool that can be used to launch a JRE7u71 uninstallation and targeted to the entire enterprise, and scheduled. Why go through the headache of a complicated uninstallation routine in PackageBoot, along with all of the testing that should go with it?

                                      • Re: Java 7 to Java 8 Upgrade Package
                                        jbaits

                                        One reason I could see not sending a blanket uninstall command would be that you do not want the uninstall to occur if the Java 8 install has not yet happened. The mass uninstall command does not have any way to determine if that is the case and you may not want to wait for Java 8 to have 100% deployment before removing the previous version. It also requires patch manager to have more network access and permissions over the client. I have many machines that patch manager can not issue commands to but do get their updates from it. I can understand separating the removal package from the install and having it's own package with prerequisite rules to detect both Java 7 and Java 8 for the sake of flexibility. I agree that you should use the right tool for the job and in some environments that is a well crafted custom package.

                                          • Re: Java 7 to Java 8 Upgrade Package
                                            Lawrence Garvin
                                            One reason I could see not sending a blanket uninstall command would be that you do not want the uninstall to occur if the Java 8 install has not yet happened.

                                            Okay, so build a Patch Manager Computer Group from a report of systems with JRE8 installed and target the uninstall task to the PMCG contaning known (and confirmed) JRE8-based systems.

                                             

                                            It also requires patch manager to have more network access and permissions over the client.

                                            That it does. It also has the benefit of providing authoritative and immediate feedback that the installation actually occurred. If the motivation for doing this is "reducing attack profile", then I would think positive confirmation would be an important part of the task execution. Merely dropping an uninstall command in a PackageBoot executable does not provide that level of confirmation. (Nor does it preclude somebody else from reinstalling JRE7 the next day.), and it increases the risk that the JRE8 installation will FAIL, given that removing JRE7 is now a prerequisite to actually installing JRE8. Not to mention potentially leaving the machine with no JRE installed at all. Presumably the JRE is installed because it is actually NEEDED.


                                             

                                            I have many machines that patch manager can not issue commands to

                                             

                                            Patch Manager also has an optional agent that addresses this challenge.

                                    • Re: Java 7 to Java 8 Upgrade Package
                                      dfoli

                                      Thanks jbaits, that is exactly what I am looking for.  All of our systems our x64 and I am using the x86 for x64 Package for the 32-bit. The 32-bit Java works for most of the company, but we have two sections that have programs that need the user to have both 32 and 64 bit Java.  This will allow me to deploy Java 8 without the x86 for x64 Package uninstalling the 64-bit Java, so that the x64 Package will be able to see it and update it.  Thank you.

                                        • Re: Java 7 to Java 8 Upgrade Package
                                          jbaits

                                          Glad to help.

                                            • Re: Java 7 to Java 8 Upgrade Package
                                              kire

                                              I know this post is a little old but I have this same issue.  I want Java 7 removed whenever I install Java 8.  Or I would even settled for running a separate uninstall task after updating to Java 8.  I have read the above and I don't know if its because its Friday with 1 hour left to work or what but I couldn't catch on to what the solution is.

                                               

                                              Like mentioned above, I am trying to reduce risk.  Having multiple versions installed sounds like no fun at all.  Not to mention moving forward Java 7 will no longer be supported, Java 8 will the only version, then Java 9 will be released, and Java 8 will become obsolete and so on.  So while its possible for both versions to co-exist its not ideal for me.

                                               

                                              What do you suggest?

                                                • Re: Java 7 to Java 8 Upgrade Package
                                                  Lawrence Garvin

                                                  My personal suggestion is to uninstall JRE7 as a completely separate task once you've confirmed the successful installation of JRE8. Generally speaking, the two versions are designed to co-exist side-by-side so there's no requirement to uninstall JRE7. Any Java application not explicitly configured to use JRE7 will begin using JRE8 as soon as it's available. As for risk, the only real risk will accrue when Oracle quits providing security updates for JRE7; otherwise, there is no real risk of co-existing runtimes, and I've seen many machines with JRE5/JRE6 and JRE6/JRE7 coexist quite happily.

                                                   

                                                  You can then use the Computer Explorer -> Installed Software feature to select the line item for JRE7 and then target it to multiple systems (or even create a custom group to contain the machines that need JRE7 uninstalled) to uninstall JRE7.

                                                    • Re: Java 7 to Java 8 Upgrade Package
                                                      kire

                                                      Thanks Lawrence for the speedy reply!

                                                       

                                                      The uninstall is what I really want to happen.  I may sit back and let them exist though.

                                                       

                                                      When you say "You can then use the Computer Explorer -> Installed Software feature to select the line item for JRE7 and then target it to multiple systems (or even create a custom group to contain the machines that need JRE7 uninstalled) to uninstall JRE7".  Are you referring to inside Patch Manager?  I don't see the Computer Explorer option inside Patch Manager.  Again its Friday.  LOL  Hope you have a good weekend.

                                                        • Re: Java 7 to Java 8 Upgrade Package
                                                          Lawrence Garvin
                                                          When you say "You can then use the Computer Explorer -> Installed Software feature to select the line item for JRE7 and then target it to multiple systems (or even create a custom group to contain the machines that need JRE7 uninstalled) to uninstall JRE7".  Are you referring to inside Patch Manager?


                                                          Yes.


                                                          Right click on a computer you know has JRE7 installed, and select "Computer Explorer" from the context menu.


                                                          1-16-2015 5-34-54 PM.png

                                                      • Re: Java 7 to Java 8 Upgrade Package
                                                        dfoli

                                                        Kire,

                                                        In the Package Boot Editor I added a Run cmd.exe at the very end with the command-line parameters (/c wmic product where "name like 'Java 7%%' AND NOT name like '%%(64-bit)'" call uninstall /nointeractive) for x86, and (/c wmic product where "name like 'Java 7%%' AND name like '%%(64-bit)'" call uninstall /nointeractive) for x64 (Remove the () from around the ends not from around 64-bit).  This remove the old jre 7 very nicely.  Thanks again jbaits.

                                                          • Re: Java 7 to Java 8 Upgrade Package
                                                            dfoli

                                                            You have to put it after the install of jre8 in upgrade packages otherwise it will uninstall the jre7 and then the package will see no java when it gets ready to install and it will fail.  Then you have no java.

                                                              • Re: Java 7 to Java 8 Upgrade Package
                                                                Lawrence Garvin
                                                                and then the package will see no java when it gets ready to install and it will fail.


                                                                This somewhat depends on which package of JRE8 you're using to do the installation. If you are using the *upgrade* package, then the absence of JRE7 would certainly be problematic.

                                                                But if you're using the *FULL* installer package, then the presence or absence of JRE7 is irrelevant.


                                                                But, there's actually a stronger reason why you should do the uninstallation of JRE7 after the *successful* installation of JRE8...

                                                                If you were to uninstall, or attempt to uninstall, JRE7 before installation JRE8, three undesirable scenarios could occur:

                                                                • The uninstall of JRE7 fails and the install of JRE8 fails, leaving the computer with no working JRE.
                                                                • The uninstall of JRE7 succeeds and the install of JRE8 fails, leaving the computer with no working JRE.
                                                                • The uninstall of JRE7 fails and the install of JRE8 succeeds, leaving you with a JRE7 mess to clean up, and hopefully a working JRE8.


                                                                Ergo, whether you do it via the package, or via a separate task, the uninstallation of the previous version should always succeed the successful installation of the newer version.

                                                                  • Re: Java 7 to Java 8 Upgrade Package
                                                                    kire

                                                                    Thanks for all the helpful responses.  Its much appreciated.  I think I downloaded the full version of JRE8.  I will double check in Patch Manager which update I published.  Also I have a test environment of 4 or 5 computers I can perform this on to see how it behaves.  Again thanks so much.

                                                                      • Re: Java 7 to Java 8 Upgrade Package
                                                                        Lawrence Garvin
                                                                        I think I downloaded the full version of JRE8


                                                                        There are only two JRE binaries, and the binaries used for the Upgrade and Full packages are identical.


                                                                        The x86 binary is used with these packages:

                                                                        • Java Runtime Environment 8u## (x86)
                                                                        • Java Runtime Environment 8u## (x86 for x64)
                                                                        • Java Runtime Environment 8u## (x86) (Upgrade)
                                                                        • Java Runtime Environment 8u## (x86 for x64) (Upgrade)


                                                                        The x64 binary is used with these packages:

                                                                        • Java Runtime Environment 8u## (x64)
                                                                        • Java Runtime Environment 8u## (x64) (Upgrade)


                                                                        What's relevant to the question is which package(s) you published to the WSUS server and then approved for installation


                                                                        • Re: Java 7 to Java 8 Upgrade Package
                                                                          dfoli

                                                                          Good luck Kire

                                                      • Re: Java 7 to Java 8 Upgrade Package
                                                        robertbell

                                                        Since Oracle changed the Java installer, one also wonders what the best way is to move from JRE Version 8 update 25, say, to Version 8 update 31. The current Solarwinds packages do not remove the former when they install the latter.

                                                          • Re: Java 7 to Java 8 Upgrade Package
                                                            Lawrence Garvin

                                                            To be sure, it's not the package that is causing this malady, but specifically a defect in the installer itself as published by Oracle. Hopefully it's an isolated defect in this release and will not appear (or will be fixed) in future releases.

                                                             

                                                            Generally speaking, these different patch versions will likely coexist. The JRE6 update 7 was intentionally left behind (ostensibly for compatibility reasons), and many systems went through continuous updates to the JRE6, and even on to JRE7 before patch admins recognized the need to manually uninstall the ancient JRE6u7 package.

                                                             

                                                            In the meantime, there are a few different ways you can deal with this malady.

                                                            The first is to just deploy the package, and then deal with cleaning up the JRE8u25 as a secondary task. You can build a Software Uninstallation task using Patch Manager's Computer Explorer -> Installed Software tab, and that task can be targeted to all of the JRE8u25 systems.

                                                            The second is to customize the JRE8u31 package to explicitly remove the JRE8u25 update. Whether you do this before or after actually installing JRE8u31 is a matter for additional discussion. If you uninstall JRE8u25 before installing JRE8u31, and the installation of JRE8u31 fails, then the system may be left with no JRE at all. (Some would say that's actually a better state than with any JRE installed.) Uninstalling JRE8u25 after installing JRE8u31, as with the previous suggestion of doing it completely separately, does presume that the two installations are completely isolated, and that removing JRE8u25 will not negatively impact JRE8u31 in any way.

                                                            Another option would be to code the uninstallation via Group Policy and do it as a system startup event.

                                                            Or just script it with a list of machine names.

                                                             

                                                            Regardless of which methodology you choose, testing in controlled conditions prior to unleashing on the organization as a whole are strongly encouraged.

                                                              • Re: Java 7 to Java 8 Upgrade Package
                                                                robertbell

                                                                It looks more like a decision on Oracle's part, since in the past manual install of the JRE occasionally failed when a prior version would not uninstall cleanly. Now, the uninstall is a separate step after the new version is installed. Ideally, Oracle will document the command-line switch to trigger a silent uninstall of all prior versions.

                                                                 

                                                                Until then, I guess I will have to modify the Solarwinds package to add a postinstallation uninstall of the previous two versions -- laptops are hard to keep current.

                                                            • Re: Java 7 to Java 8 Upgrade Package
                                                              frgpugs

                                                              Just in case anyone wants to use PSExec from sysinternals to do the uninstalls like I did here are the scripts for the uninstalls.  I made text files from a solarwinds report and ran it that way.  Took a few days to get it all correct but it did work.  You will want to change document.txt to whatever your text file is named and then domain\account to whatever domain and account you want to use for credentials

                                                               

                                                              7u72

                                                              PsExec.exe @(DOCUMENT.TXT) -h -u DOMAIN\ACCOUNT MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F03217072FF} /qn

                                                               

                                                               

                                                              8u25

                                                              PsExec.exe @(DOCUMENT.txt) -h -u DOMAIN\ACCOUNT MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83218025F0} /qn