If you have the Software Distribution site, it creates Tasks to deploy software, but I prefer to use Fixlets for software installation. It has to do with the default difference between how an action based on a Task or a Fixlet determine success.
Task - Did all the action script lines run?
Fixlet - Does the fixlet relevance evaluate to False after running the action script (with no errors)?
Anyway …
To make life easier, let’s start by looking at the Java 7u45 Update fixlet. What it is doing is looking for clients that already have a version of Java installed that is less than 7u45, right? Open the fixlet “
Java Runtime Environment 7 update 45 Available (x64) (JRE 7 Installed)
” and go to the
Details
tab.
Relevance #1 thru #5 are making sure we are on a Windows x64 based system with a TEM Client greater than v6.0 (based on requirements based on the commands used in the Action Script later on). You will want to use these 5 clauses in your Fixlet so copy them.
Relevance #6 is looking to see if Java is already installed but with a version less than “7.0.450” and that it is the 64-bit version of Java. You’re going to want to use part of this Relevance clause. You are only interested in Java NOT being installed already. The #6 clause lists the various names that might be included in the Uninstall DisplayName. The clause we’re going to write will look for a key with one of these names, and if it can’t find it, return TRUE.
NOT (Exists keys whose (value “DisplayName” of it as string as lowercase contains “j2se runtime environment” OR value “DisplayName” of it as string as lowercase contains “runtimeenvironment” OR value “DisplayName” of it as string as lowercase starts with “java™” OR value “DisplayName” of it as string as lowercase starts with “java 7”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of x64 registry)
Relevance #7 is looking for evidence that Java is already installed. You shouldn’t need this one.
Relevance #8 is looking to make sure that the 64bit version of Java is not already installed. Again, I don’t think you will need this one.
Relevance #9 is making sure that a version greater than “7.0.450” is not already installed. One of the features of Java that causes me heartburn is that you can have multiple versions of it installed, and a Java application can decided which version it wants to use (if it’s written to do so). This means that if you leave a vulnerable version installed even with newer instances installed, malicious code can simply request that it’s calls be handled by the vulnerable version. I tend to make heavy use of the “Java Runtime Environment - Multiple 64-bit JRE Versions Installed…” fixlets to remove older versions when possible.
From here, I believe all you need to do is copy the Action script as is, from the Java update fixlet.
One warning. The fixlet as created above will simply look to see if the 64bit version of Java is installed on a computer or not. It will not care if the 32bit version is already installed on the computer. You would need to AND a copy of the clause listed so that it looked at " of registry" as well. That clause would look something like …
(NOT (Exists keys whose (value “DisplayName” of it as string as lowercase contains “j2se runtime environment” OR value “DisplayName” of it as string as lowercase contains “runtimeenvironment” OR value “DisplayName” of it as string as lowercase starts with “java™” OR value “DisplayName” of it as string as lowercase starts with “java 7”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of x64 registry)) AND (NOT (Exists keys whose (value “DisplayName” of it as string as lowercase contains “j2se runtime environment” OR value “DisplayName” of it as string as lowercase contains “runtimeenvironment” OR value “DisplayName” of it as string as lowercase starts with “java™” OR value “DisplayName” of it as string as lowercase starts with “java 7”) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry))
The clause above will return FALSE if either the 32bit or the 64bit version of Java is installed on a computer.
Writing this as a Fixlet means that any Actions will re-evaluate the clauses, and assuming Java successfully installed, should return FALSE for the last clause, hence “Fixed” should be returned as the result. You could just as easily do this with a Task using the exact same Clauses and Action Script.
If this is not enough information, let me know.
If someone has a better way to handle this kind of situation, I’m open to suggestions.
Wow Tim that was an amazing explanation on what our java fixlets do.
Hey John, I basically made up a version of a fixlet that you might work but I haven’t tested it. It’s basically a tweaked version of the java fixlet that detects for multiple versions of java being installed on your system (we’re tweaking it to look for zero instances of java). Let us know if this works.
I would add to this that you probably want to install both the 32 and 64bit versions of Java on 64bit systems. The default web browser in Win7 x64 is the 32bit version of IE, which I believe will need the 32bit version of Java to be installed…
Relevance below is from what liuhoting attached, but will look at the 32 and 64bit registries (native registry will search the x64 registry on 64bit systems and the 32bit on 32bit systems).
((it = 0) of number of keys whose (((it contains “java” OR it contains “j2se”) and (not (it contains “development kit” or it contains “auto updater” or it contains “javafx”))) of (value “DisplayName” of it as string as lowercase) AND value “DisplayVersion” of it as string as version >= “1.4.2” AND (exists value “Publisher” whose (it as string as lowercase contains “oracle” or it as string as lowercase contains “sun”) of it)) of key “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of native registry) or((it = 0) of number of keys whose (((it contains “java” OR it contains “j2se”) and (not (it contains “development kit” or it contains “auto updater” or it contains “javafx”))) of (value “DisplayName” of it as string as lowercase) AND value “DisplayVersion” of it as string as version >= “1.4.2” AND (exists value “Publisher” whose (it as string as lowercase contains “oracle” or it as string as lowercase contains “sun”) of it)) of key “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of x32 registry)
Your action would need to include both versions, but only install the 64bit if the computer is 64bit: