12
edits
Changes
Java
,add 32+64 bits all-in-one package
</package>
</packages>
</source>
===Install JRE with msi without removing old version in a mixed 32-bit/64-bit environment in one package===
The intent is to have one package which installs Java for all Windows machines.
It installs i586 version of Java on 32-bit OS, and i586 and x64 version of Java on 64-bit OS.
There is also a "REG" command which removes the Java AutoUpdate.
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<packages>
<!-- jre install with the msi ; for 32-bit and 64-bit hosts -->
<package
id="Java"
name="Java(TM) 7"
revision="%version%"
reboot="false"
priority="178"
>
<variable name="updatever" value="07" />
<variable name="shortupdatever" value="7" />
<variable name="version" value="7.0.%updatever%" />
<variable name="autoupdate" value="0" />
<check type="logical" condition="or">
<check type="uninstall" condition="exists" path="Java 7" />
<check type="uninstall" condition="exists" path="Java 7 Update %updatever%" />
<check type="uninstall" condition="exists" path="Java 7 Update %shortupdatever%" />
</check>
<install cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
<exit code='any' />
</install>
<!-- .exe install (XP, 2003) -->
<install os=".+5\.[1-2]\.\d{4}"
cmd='%SOFTWARE%\java\jre-7u%shortupdatever%-windows-i586.exe /s REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' />
<!-- .msi (Seven) install http://wpkg.org/Java#Install_JRE_with_msi_without_removing_old_version_in_a_mixed_32-bit.2F64-bit_environment -->
<install os=".+6\.[0-1]\.\d{4}"
cmd='msiexec /qn /i %SOFTWARE%\java\jre1.7.0_%updatever%\jre1.7.0_%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' />
<!-- remove Java Quick Starter -->
<install cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</install>
<install cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</install>
<!-- remove Java Auto Update -->
<install cmd='REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v SunJavaUpdateSched /f'>
<exit code='any' />
</install>
<downgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
<exit code='any' />
</downgrade>
<!-- .exe install (XP, 2003) -->
<downgrade os=".+5\.[1-2]\.\d{4}"
cmd='%SOFTWARE%\java\jre-7u%shortupdatever%-windows-i586.exe /s REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' />
<!-- .msi (Seven) install http://wpkg.org/Java#Install_JRE_with_msi_without_removing_old_version_in_a_mixed_32-bit.2F64-bit_environment -->
<downgrade os=".+6\.[0-1]\.\d{4}"
cmd='msiexec /qn /i %SOFTWARE%\java\jre1.7.0_%updatever%\jre1.7.0_%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' />
<!-- remove Java Quick Starter -->
<downgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</downgrade>
<downgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</downgrade>
<!-- remove Java Auto Update -->
<downgrade cmd='REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v SunJavaUpdateSched /f'>
<exit code='any' />
</downgrade>
<upgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
<exit code='any' />
</upgrade>
<!-- .exe install (XP, 2003) -->
<upgrade os=".+5\.[1-2]\.\d{4}"
cmd='%SOFTWARE%\java\jre-7u%shortupdatever%-windows-i586.exe /s REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' />
<!-- .msi (Seven) install http://wpkg.org/Java#Install_JRE_with_msi_without_removing_old_version_in_a_mixed_32-bit.2F64-bit_environment -->
<upgrade os=".+6\.[0-1]\.\d{4}"
cmd='msiexec /qn /i %SOFTWARE%\java\jre1.7.0_%updatever%\jre1.7.0_%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' />
<!-- remove Java Quick Starter -->
<upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</upgrade>
<upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</upgrade>
<!-- remove Java Auto Update -->
<upgrade cmd='REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v SunJavaUpdateSched /f'>
<exit code='any' />
</upgrade>
<remove cmd='msiexec /qn /x {26A24AE4-039D-4CA4-87B4-2F832170%updatever%FF}' />
<!-- jre 64-bit install with the msi ; for 64-bit hosts only -->
<check architecture="x64" type="logical" condition="or">
<check type="uninstall" condition="exists" path="Java 7 (64-bit)" />
<check type="uninstall" condition="exists" path="Java 7 Update %updatever% (64-bit)" />
<check type="uninstall" condition="exists" path="Java 7 Update %shortupdatever% (64-bit)" />
</check>
<install architecture="x64" cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
<exit code='any' />
</install>
<install architecture="x64"
cmd='msiexec /qn /i %SOFTWARE%\java\jre1.7.0_%updatever%_x64\jre1.7.0_%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1'
/>
<!-- remove Java Quick Starter -->
<install architecture="x64" cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</install>
<install architecture="x64" cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</install>
<upgrade architecture="x64" cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe' >
<exit code='any' />
</upgrade>
<upgrade architecture="x64"
cmd='msiexec /qn /i %SOFTWARE%\java\jre1.7.0_%updatever%_x64\jre1.7.0_%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1'
/>
<!-- remove Java Quick Starter -->
<upgrade architecture="x64" cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</upgrade>
<upgrade architecture="x64" cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" -unregister'>
<exit code='any' />
</upgrade>
<remove architecture="x64" cmd='msiexec /qn /x {26A24AE4-039D-4CA4-87B4-2F864170%updatever%FF}' />
</package>
</packages>
</source>