At one point this used to work but now we are having the following issues:
I have a batch file to cleanup old versions of Java. I created this because the one provided in BigFix caused serious issues in our environment and created more problems than it solved. Here is a sample from the first several lines of the batch file:
:: Sun / Oracle Java Runtime Environment (JRE) Uninstallation Script
REM JavaFX 2.1.1
start /wait MsiExec.exe /uninstall {1111706F-666A-4037-7777-211328764D10} /qn /norestart
REM JavaFX 2.1.0
start /wait MsiExec.exe /uninstall {1111706F-666A-4037-7777-210328764D10} /qn /norestart
REM JRE Runtime Environment 8 Update 161
start /wait MsiExec.exe /uninstall {26A24AE4-039D-4CA4-87B4-2F32180161F0} /qn /norestart
start /wait MsiExec.exe /uninstall {26A24AE4-039D-4CA4-87B4-2F64180161F0} /qn /norestart
REM JRE Runtime Environment 8 Update 152
start /wait MsiExec.exe /uninstall {26A24AE4-039D-4CA4-87B4-2F32180152F0} /qn /norestart
start /wait MsiExec.exe /uninstall {26A24AE4-039D-4CA4-87B4-2F64180152F0} /qn /norestart
When BigFix runs the job, it says it completes successfully yet every single computer that reports as successful still reports as relevant. If I go to said machines, I can confirm that multiple versions of JAVA are still installed. If I manually run the batch script, it runs successfully and all old versions of JAVA are removed. What is it about BigFix that is not running this script properly?
32-bit redirection, most likely?
Add
action uses wow64 redirection false
somewhere before running the batch amd see whether that helps.
I gave that a try and ended up with the same result.
How are you running this? Are you creating it as a __createfile or are you having it download the .bat on demand? If you’re making it as a __createfile maybe you have to escape the {} because it thinks it’s relevance?
Does the client log give any useful error codes when you try to run it?
Here are the relevances and actions:
Relevance 1
Show collapsed relevance
/* Desktop OS /
(
(
name of it = "Win7"
AND
NOT x64 of it
)
OR
(
name of it = "Win7"
AND
x64 of it
)
OR
(
name of it = "Win8"
AND
NOT x64 of it
)
OR
(
name of it = "Win8"
AND
x64 of it
)
OR
(
name of it = "Win8.1"
AND
NOT x64 of it
)
OR
(
name of it = "Win8.1"
AND
x64 of it
)
OR
(
name of it = “Win10”
)
)
of operating system
AND
TRUE
Show indented relevance
/ Desktop OS / ((name of it = “Win7” AND NOT x64 of it) OR (name of it = “Win7” AND x64 of it) OR (name of it = “Win8” AND NOT x64 of it) OR (name of it = “Win8” AND x64 of it) OR (name of it = “Win8.1” AND NOT x64 of it) OR (name of it = “Win8.1” AND x64 of it) OR (name of it = “Win10”)) of operating system AND TRUE
Relevance 2
Show collapsed relevance
/ JAVA installed
and
version 8.0.161
or
lower */
(
exists value "UninstallString"
whose
(
it as string contains “MsiExec”
)
of keys
whose
(
value “DisplayName” of it as string contains “Java 8”
)
of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of
(
x32 registries; x64 registries
)
)
AND
(
exists value "DisplayName"
whose
(
it as string contains “Java 8”
)
of keys
whose
(
value “DisplayVersion” of it as string as version <= “8.0.1610.0”
)
of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of
(
x32 registries; x64 registries
)
)
Show indented relevance
/* JAVA installed and version 8.0.161 or lower / (exists value “UninstallString” whose (it as string contains “MsiExec”) of keys whose (value “DisplayName” of it as string contains “Java 8”) of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registries; x64 registries)) AND (exists value “DisplayName” whose (it as string contains “Java 8”) of keys whose (value “DisplayVersion” of it as string as version <= “8.0.1610.0”) of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registries; x64 registries))
Relevance 3
Show collapsed relevance
/ JAVA installed
and
version 8.0.1620.12*/
(
exists value "UninstallString"
whose
(
it as string contains “MsiExec”
)
of keys
whose
(
value “DisplayName” of it as string contains “Java 8”
)
of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of
(
x32 registries; x64 registries
)
)
AND
(
exists value "DisplayName"
whose
(
it as string contains “Java 8”
)
of keys
whose
(
value “DisplayVersion” of it as string as version = “8.0.1620.12”
)
of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of
(
x32 registries; x64 registries
)
)
Show indented relevance
/* JAVA installed and version 8.0.1620.12*/ (exists value “UninstallString” whose (it as string contains “MsiExec”) of keys whose (value “DisplayName” of it as string contains “Java 8”) of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registries; x64 registries)) AND (exists value “DisplayName” whose (it as string contains “Java 8”) of keys whose (value “DisplayVersion” of it as string as version = “8.0.1620.12”) of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (x32 registries; x64 registries))
Actions
Action1 (default)
Script Type BigFix Action Script
prefetch c332390a1f963e57103fc8411725bd18b89a57ca sha1:c332390a1f963e57103fc8411725bd18b89a57ca size:116773176 http://server_dedacted:52311/Uploads/c332390a1f963e57103fc8411725bd18b89a57ca/JAVA.tmp sha256:59ea5566cb7593ded791ca737d8d89de2fb8f395b2f7a6e302c0409efb6ef182
extract c332390a1f963e57103fc8411725bd18b89a57ca
action uses wow64 redirection false
waithidden “{pathname of system folder & “\cmd.exe”}” /Q /C “{(pathname of client folder of current site) & “__Download\Java_Uninstall.bat”}”
I’ve discovered that if I try to run said batch script manually I get the same result. When I run the batch file as administrator, it completes successfully and removes the old version of JAVA. Now how do I get BigFix to run this batch script as administrator?
The Java installer makes some assumptions about user profile directories existing, that are untrue for the 32-bit SYSTEM profile. Have a look at the JRE ibstaller fixlets in “Updates for Windows Applications” to see the workarounds the BigFix content is using (creating filesystem links) and try using that method.
I’ve tried using:
Action uses wow64 redirection false
But that hasn’t fixed it either.
Right, Java is … Special.
Look at the Java fixlets, you’ll find the ‘linkd’ commands involved in creating the symlinks for 32-bit systemprofile directory.