Changes

Java

5,209 bytes added, 11:33, 17 December 2009
Update: install with msi package
Actually, with Update 10 and later Sun has introduced as default the so called "patch in place" update mechanism (see: http://java.sun.com/javase/6/docs/technotes/guides/jweb/otherFeatures/jre_install.html) which automatically removes the previous version of the same Java family (unless you turned off patch-in-place using the installer). So the line that tries to remove a previously installed Update 10 (msiexec /qn /x {26A24AE4-039D-4CA4-87B4-2F83216010FF}) is not strictly necessary (if you installed a 'Family JRE' and not a 'Static JRE').
==== JRE without Java Quick Starter on 32-bit hosts ====The following installs JRE Update 16 17 and then removes the "Java Quick Starter" service; if you want to keep "Java Quick Starter" service then just remove the line with "jqs.exe -unregister", but remeber to stop/kill JQS before uninstallation.
<source lang="xml">
</source>
====Install JRE with msi without removing old version in a mixed 32-bit/64-bit environment====
On 64-bit hosts installing the exe doesn't work.
jre-6u17-windows-i586-s.exe is a 32bit app containing a msi, a cab and some other files.
On a 32-bit host it unpacks in in c:\Windows\system32\config\systemprofile\AppData\LocalLow\Sun\Java\jre1.6.0_17\
On a 64-bit host it unpacks in c:\Windows\SysWOW64\config\systemprofile\AppData\LocalLow\Sun\Java\jre1.6.0_17
The silent install on a 64-bit host is still looking for the msi in the 32-bit directory.
 
So the best thing to do is to install the msi package.
Copy the content of \Windows\SysWOW64\config\systemprofile\AppData\LocalLow\Sun\Java\jre1.6.0_17
on your server and install from it
 
if a 64bits msiexec is started by the exe then it can't find jre1.6.0_17.msi as it is not there.
System32 when in 64bits mode is not the same system32 you got in 32bits mode
 
Copy the content of c:\Windows\system32\config\systemprofile\AppData\LocalLow\Sun\Java\jre1.6.0_17\ or c:\Windows\SysWOW64\config\systemprofile\AppData\LocalLow\Sun\Java\jre1.6.0_17
on your server and install from it.
 
In this example, no uninstall of the old java versions as it is quite time consuming.
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<packages>
<!-- new jre install with the msi ; for 32-bit hosts only -->
<package
id="jre"
name="Java(TM) 6 Update 17"
revision="7"
reboot="false"
priority="178"
>
<check type="logical" condition="or">
<check
type="registry"
condition="equals"
path="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE"
value="AMD64"
/>
<check
type="uninstall"
condition="exists"
path="Java(TM) 6 Update 17"
/>
<check
type="registry"
condition="equals" path="HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216017FF}\DisplayName"
value="Java(TM) 6 Update 17"
/>
<check
type="file"
condition="versiongreaterorequal"
path="%PROGRAMFILES(x86)%\Java\jre6\bin\java.exe"
value="6.0.170.4"
/>
</check>
 
<install cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
<exit code='0' />
<exit code='1' />
<exit code='128' />
</install>
<install
cmd='msiexec /qn /i %SOFTWARE%\jre\jre1.6.0_17.msi ADDLOCAL=ALL REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 CUSTOM=1'
/>
 
<upgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe' >
<exit code='0' />
<exit code='1' />
<exit code='128' />
</upgrade>
<upgrade
cmd='msiexec /qn /i %SOFTWARE%\jre\jre1.6.0_17.msi ADDLOCAL=ALL REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 CUSTOM=1'
/>
<upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre6\bin\jqs.exe %PROGRAMFILES%\Java\jre6\bin\jqs.exe -unregister'>
<exit code='1' />
</upgrade>
<upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre6\bin\jqs.exe %PROGRAMFILES%\Java\jre6\bin\jqs.exe -unregister'>
<exit code='1' />
</upgrade>
 
</package>
 
<!-- new jre install with the msi ; for 64-bit hosts only -->
<package
id="jre-64"
name="Java(TM) 6 Update 17"
revision="7"
reboot="false"
priority="178"
>
 
<check type="logical" condition="or">
<check
type="registry"
condition="equals"
path="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE"
value="x86"
/>
<check
type="uninstall"
condition="exists"
path="Java(TM) 6 Update 17 (64-bit)"
/>
<check
type="registry"
condition="equals" path="HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216017FF}\DisplayName"
value="Java(TM) 6 Update 17 (64-bit)"
/>
<check
type="file"
condition="versiongreaterorequal"
path="%PROGRAMFILES%\Java\jre6\bin\java.exe"
value="6.0.170.4"
/>
</check>
 
<install cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
<exit code='0' />
<exit code='1' />
<exit code='128' />
</install>
<install
cmd='msiexec /qn /i %SOFTWARE%\jre\jre1.6.0_17.msi ADDLOCAL=ALL REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 CUSTOM=1'
/>
 
<upgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe' >
<exit code='0' />
<exit code='1' />
<exit code='128' />
</upgrade>
<upgrade
cmd='msiexec /qn /i %SOFTWARE%\jre\jre1.6.0_17.msi ADDLOCAL=ALL REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 CUSTOM=1'
/>
 
</package>
 
</packages>
</source>
 
 
 
====Disable Automatic Update====
Automatic updates can be disabled with JAVAUPDATE=0 JU=0 AUTOUPDATECHECK=0; if these command line switches should not work for you, then you can alter the registry (read [[Adding Registry Settings]] for that) to disable autoupdate:
43
edits