<upgrade cmd='msiexec /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160070}'><exit code='0' /><exit code='1605' /></upgrade>
</source>
==Java Quick Starter instructions for JRE version 6==
"Java Quick Starter" is described as a prefetching service that should make java applications start faster. But it has a drawback: it must be killed before uninstallation or installation fails, and uninstallation via msiexec using versions older than JRE 7 does not seem to be smart enough to do this.
This is not a problem though, simply insert the following snippet into the very first of your install AND upgrade commands of the xml from the next paragraph.
<source lang="xml">
<install cmd='net STOP JavaQuickStarterService' >
<exit code='2' />
</install>
</source>
This will stop the java quick-start service prior to installation or upgrade. In case it was already stopped (Errorlevel 2) the error is simply ignored. If you want to use it, be sure to remove the commands (%PROGRAMFILES%\Java\jre6\bin\jqs.exe -unregister') that disable the 'Java Quick Starter' from your package definition.
Although there seems to be no command line switches to allow/disallow the installation of "Java Quick Starter", the jqs.exe binary itself can be used immediately after installation in order to add/remove the "Java Quick Starter" service.
The following table shows the command line switches you can invoke with the jqs.exe binary:
C:\Program Files\Java\jre6\bin>jqs -help
Usage: jqs <mode> [<options>]
The following modes are supported:
-help print this help message and exit
-register install JQS service and register browser startup detectors
-unregister uninstall JQS service and unregister startup detectors
-enable enable JQS service
-disable disable JQS service
-pause pause prefetching
-resume resume prefetching
-version print version of the associated Java Runtime
Options include:
-config <config> set JQS configuration file
-profile <profile> set JQS profile file
-logfile <logfile> set JQS log file
-verbose <level> verbose operation
This requires the Windows Offline installation package available from Sun. Note that a particular Java family install package does not remove already installed versions of another Java family, so JRE 1.5 and JRE 1.6 can coexist; all older 1.6 update versions (1.6.0 up to but not including the most recent version) are uninstalled by the following packaging (note that the update version seems to be no more reflected in the last number in the Uninstall ID).
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').
Patch-in-place sometimes fails with "Error 25099. Unzipping core files failed", returning error code 1603 from msiexec. Sometimes installation will succeed on a later reboot without any intervention, but sometimes it continues to fail. As of December 2010, the root cause is not known, but Sun/Oracle suggests (at http://www.java.com/en/download/help/error_25099.xml) removing %PROGRAMFILES%\Java\jre6 before retrying installation. A fully-automatic workaround requires the ability to execute commands in response to particular error codes and thus may need to take the form of a batch program wrapped around msiexec.
== Disable Automatic Update - older versions ==