Installation von Java7.x 32bit unter Win7-64bit

Für die Installation von Java7.x 32bit unter Win764bit muss ein Umweg gegangen werden: Die Java32bit.exe ausführen und unter z.B. Win7 in C:\User\AppData\LocalLow\Sun\Java\java1.7.0_21 den kompletten Ordner kopieren und die MSI zum Installieren unter Win7x64 benutzen:

[Winbatch_Install_64bitOS_32-Bit]
msiexec /i "%SCRIPTPATH%\$2Executable64$" /qb-! REBOOT=Suppress WEB_JAVA=1 JAVAUPDATE=0 /L*v C:\tmp\Java32bitDeployLog64bitOS.txt

Aufgrund von einigen Problemen ab Java7 filter ich in meinem Skript erst nach der Version und lösche dann komplett alle vorherigen Java7-Versionen sowie einen fehlerhaften Registry-Eintrag der Probleme machen kann:

if FileExists("%ProgramFiles32Dir%\Java\jre7\")
              comment "Start uninstalling old version"
			Winbatch_Uninstall_Java7_32
			Registry_KeysLoeschen_Java7_32
      endif
if FileExists("%ProgramFiles64Dir%\Java\jre7\")
              comment "Start uninstalling old version"
			Winbatch_Uninstall_Java7_64
			Registry_KeysLoeschen_Java7_64
      endif
[Winbatch_Uninstall_Java7_32]
;REM JRE Runtime Environment 7.0 Update 21
msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217021FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 17
msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217015FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 15
msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217015FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 13
msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217013FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 11
msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217011FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 10
msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217010FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 7
msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217007FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 5
msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217005FF}  /qb-! REBOOT=Suppress
[Winbatch_Uninstall_Java7_64]
;REM JRE Runtime Environment 7.0 Update 21 (x64)
msiexec /x {26A24AE4-039D-4CA4-87B4-2F86417021FF} /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 17 (x64)
msiexec /x {26A24AE4-039D-4CA4-87B4-2F86417015FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 15 (x64)
msiexec /x {26A24AE4-039D-4CA4-87B4-2F86417015FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 13 (x64)
msiexec /x {26A24AE4-039D-4CA4-87B4-2F86417013FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 11 (X64)
msiexec /x {26A24AE4-039D-4CA4-87B4-2F86417011FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 10 (x64)
msiexec /x {26A24AE4-039D-4CA4-87B4-2F86417010FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 9 (x64)
msiexec /x {26A24AE4-039D-4CA4-87B4-2F86417009FF}  /qb-! REBOOT=Suppress
;REM JRE Runtime Environment 7.0 Update 4 (x64)
msiexec /x {26A24AE4-039D-4CA4-87B4-2F86417004FF}  /qb-! REBOOT=Suppress
[Registry_KeysLoeschen_Java7_32]
;REM JRE Runtime Environment 7.0 Update 21
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF238120712FF]
;REM JRE Runtime Environment 7.0 Update 17
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF238120771FF]
;REM JRE Runtime Environment 7.0 Update 15
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF238120751FF]
;REM JRE Runtime Environment 7.0 Update 13
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF238120731FF]
;REM JRE Runtime Environment 7.0 Update 11
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF238120711FF]
;REM JRE Runtime Environment 7.0 Update 10
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF238120701FF]
;REM JRE Runtime Environment 7.0 Update 7
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF238120770FF]
;REM JRE Runtime Environment 7.0 Update 5
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF238120750FF]
[Registry_KeysLoeschen_Java7_64]
;REM JRE Runtime Environment 7.0 Update 21 (x64)
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF268140712FF] 
;REM JRE Runtime Environment 7.0 Update 17 (x64)
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF268140771FF]
;REM JRE Runtime Environment 7.0 Update 15 (x64)
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF268140751FF]
;REM JRE Runtime Environment 7.0 Update 13 (x64)
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF268140731FF]
;REM JRE Runtime Environment 7.0 Update 11 (X64)
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF268140711FF]
;REM JRE Runtime Environment 7.0 Update 10 (x64)
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF268140701FF]
;REM JRE Runtime Environment 7.0 Update 9 (x64)
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF268140790FF]
;REM JRE Runtime Environment 7.0 Update 4 (x64)
deletekey [HKLM\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF268140740FF]

(en/de) Uninstall without using MSI product IDs / Deinstallation ohne MSI Product IDs

(en) If like a while ago me you're confronted with the problem that you need to deinstall all the different old Java installs on all clients and you don't want to use MSI product IDs or want to make absolutely sure that you won't miss a single version, then maybe you'll be better off using Windos Management Instrumentation:

(de) Wer wie ich kürzlich vor dem Problem steht, dass alle alten Java Installationen gelöscht werden sollen, und sich dabei nicht auf die MSI Product IDs beziehen möchte oder ganz sicher gehen will, dass keine Version ausgelassen wird, der ist vielleicht mit der Winows Management Instrumentation besser bedient:

 
; (en) silently remove all java versions 
; (de) alle Java Verisonen still entfernen  
wmic product where "name like 'Java%'" call uninstall /nointeractive
; (en) remove all java 6 versions
; (de) alle Java 6 Versionen still entfernen 
wmic product where "name like 'Java(TM) 6%'" call uninstall /nointeractive
; (en) remove all java 7 versions silently
; (de) alle Java 7 Versionen still entfernen
wmic product where "name like 'Java 7%%'" call uninstall /nointeractive

(en) Warning: This method of uninstalling will also remove any other MSI product whose name might correspond with the expression, so you may want to check for false positives first (i.e.: wmic product where “name like 'Java%'” get name)

(de) Vorsicht: diese Deinstallationsmethode würde auch alle sonstigen MSI-Produkte entfernen, deren Namen evtl. dem jeweiligen Muster entsprechen, also vielleicht erst vergewissern, dass es keine unerwünschten Übereinstimmungen gibt (z.B.: wmic product where “name like 'Java%'” get name)