11
edits
Changes
Java
,→Java Runtime Environment (JRE) 6
<remove cmd='msiexec /qn /x {26A24AE4-039D-4CA4-87B4-2F832160%version%FF}' />
</package>
</source>
==Install JRE6 with EXE==
No disrespect to the others who created this script. It was included with the WPKG install, but I edited it to make it more useful in a generic environment. This install 32-bit on both architectures as it is very useful when using both 64 and 32 bit browsers. The 32-bit install is the check type as well. I have tried to annotate as often as possible with comments so the next person using it can further customize it easily. I left a block at the end for misc settings. I like to put the code for turning off Auto-Update there so it runs every time to make sure it doesn't come back.
Note that I have left the uninstall in as a precursor to make sure the correct version is installed. This will allow for later versions to be installed, but this sets a baseline. Others have not used it due to it taking too long. I didn't notice any major delays in my running and editing of this script.
''Variables:''<br>
PKG_VERSION: type in the version of the installer, this will fill in the version number in the installer<br>
PKG_DESTINATION: this is the location of the 32-bit install. Because the program files directory changes depending on architecture, this is necessary to distinguish what type of machine you are installing on. <br>
SOFTWARE: set in the WPKG client install, per best practice <br>
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<packages:packages xmlns:packages="http://www.wpkg.org/packages"
xmlns:wpkg="http://www.wpkg.org/wpkg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.wpkg.org/packages ../xsd/packages.xsd">
<package
id="JRE6"
name="Java Runtime Environment 6"
revision="%PKG_VERSION%"
reboot="false"
priority="10">
<!-- Set Variables -->
<variable name="PKG_VERSION" value="33" />
<variable name="PKG_DESTINATION" value="%ProgramFiles(x86)%\Java\jre6\bin" architecture="x64"/>
<variable name="PKG_DESTINATION" value="%ProgramFiles%\Java\jre6\bin" architecture="x86"/>
<!-- Check for uninistall -->
<check type="uninstall" condition="exists" path="Java.TM. 6 Update [0-9]+" />
<!-- check install with version -->
<check type="file" condition="versiongreaterorequal" path="%PKG_DESTINATION%\java.exe" value="6.0.%PKG_VERSION%" />
<!-- Begin Install Block -->
<!-- stop quick start service -->
<install cmd="%ComSpec% /c net stop JavaQuickStarterService">
<exit code="2" />
</install>
<!-- Set baseline by removing old versions -->
<!-- remove 32-bit version -->
<install cmd="%ComSpec% /c for /L %V in (0,1,9) do @msiexec /passive /x {3248F0A8-6813-11D6-A77B-00B0D01600%V0}">
<exit code="1605" />
</install>
<install cmd="%ComSpec% /c for /L %V in (10,1,%PKG_VERSION%) do @msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F832160%VFF}">
<exit code="1605" />
</install>
<!-- remove 64-bit version -->
<install architecture="x64" cmd="%ComSpec% /c for /L %V in (10,1,%PKG_VERSION%) do @msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F864160%VFF}">
<exit code="1605" />
</install>
<!-- install latest version, only i586 for 32-bit, but install both i586 and x64 on 64-bit systems -->
<install architecture="x86" cmd='"%SOFTWARE%\Java\jre-6u%PKG_VERSION%-windows-i586.exe" /s /v "/passive /norestart /log %TMP%\JRE6_x86.log ADDLOCAL=ALL IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"' />
<install architecture="x64" cmd='"%SOFTWARE%\Java\jre-6u%PKG_VERSION%-windows-i586.exe" /s /v "/passive /norestart /log %TMP%\JRE6_AMD64.log ADDLOCAL=ALL IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"' />
<install architecture="x64" cmd='"%SOFTWARE%\Java\jre-6u%PKG_VERSION%-windows-x64.exe" /s /v "/passive /norestart /log %TMP%\JRE6_AMD64.log ADDLOCAL=ALL IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"' />
<!-- End Install Block -->
<!-- Begin upgrade Block -->
<!-- stop quick start service -->
<upgrade cmd="%ComSpec% /c net stop JavaQuickStarterService">
<exit code="2" />
</upgrade>
<!-- Set baseline by removing old versions -->
<!-- remove 32-bit version -->
<upgrade cmd="%ComSpec% /c for /L %V in (0,1,9) do @msiexec /passive /x {3248F0A8-6813-11D6-A77B-00B0D01600%V0}">
<exit code="1605" />
</upgrade>
<upgrade cmd="%ComSpec% /c for /L %V in (10,1,%PKG_VERSION%) do @msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F832160%VFF}">
<exit code="1605" />
</upgrade>
<!-- remove 64-bit version -->
<upgrade architecture="x64" cmd="%ComSpec% /c for /L %V in (10,1,%PKG_VERSION%) do @msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F864160%VFF}">
<exit code="1605" />
</upgrade>
<!-- upgrade to latest version -->
<upgrade architecture="x86" cmd='"%SOFTWARE%\Java\jre-6u%PKG_VERSION%-windows-i586.exe" /s /v "/passive /norestart /log %TMP%\JRE6_x86.log ADDLOCAL=ALL IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"' />
<upgrade architecture="x64" cmd='"%SOFTWARE%\Java\jre-6u%PKG_VERSION%-windows-i586.exe" /s /v "/passive /norestart /log %TMP%\JRE6_AMD64.log ADDLOCAL=ALL IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"' />
<upgrade architecture="x64" cmd='"%SOFTWARE%\Java\jre-6u%PKG_VERSION%-windows-x64.exe" /s /v "/passive /norestart /log %TMP%\JRE6_AMD64.log ADDLOCAL=ALL IEXPLORER=1 MOZILLA=1 REBOOT=Suppress"' />
<!-- End Upgrade Block -->
<!-- Begin Uninstall Block -->
<!-- stop quick start service -->
<remove cmd="%ComSpec% /c net stop JavaQuickStarterService">
<exit code="2" />
</remove>
<!-- remove 32-bit version -->
<remove architecture="x86" cmd="msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F832160%PKG_VERSION%FF}" />
<!-- remove 64-bit version -->
<remove architecture="x64" cmd="msiexec /passive /x {26A24AE4-039D-4CA4-87B4-2F864160%PKG_VERSION%FF}" />
<!-- End Uninstall Block -->
<!-- Begin Misc Settings Block -->
<!-- End Misc Settings Block -->
</package>
</packages:packages>
</source>