Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Tuesday, November 2, 2010

I was getting tired of some of the problems with the Java core.zip install failure so I came up with this script. It isn't pretty but it does work to install or fix a machine that currently messed up. Test it, use at your own risk

------------------------

'On Error Resume Next
Dim WshShell, strKeyPath
dim filesys, demofolder
set WshShell = WScript.CreateObject("WScript.Shell")
set filesys = CreateObject ("Scripting.FileSystemObject")

Installed=0 ' I haven't installed Java correctly yet
'determine if this is a 64bit machine
Set Wmi = GetObject("winmgmts:\\.\root\CIMV2")
Set Col = Wmi.ExecQuery("SELECT * FROM Win32_Processor")
For Each Obj in Col
MachineType= Obj.AddressWidth
next


'''Install Java Loop
Do Until Installed=1

'Install Java
WshShell.run("msiexec /i jre1.6.0_22.msi /qb IEXPLORER=1 MOZILLA=1 REBOOT=Suppress JAVAUPDATE=0"), 0, True

'check to see if it installed correctly


if filesys.FileExists("c:\Program Files\Java\jre6\Core.zip") then
FixJava(MachineType)
elseif filesys.FileExists("c:\Program Files (x86)\Java\jre6\core.zip") then
FixJava(MachineType)
else
Installed=1
end if
Loop

Sub FixJava(MachineType)


if MachineType=32 then

'''''''''x86 runtime

''delete the registry entries FOR X86

strKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216022FF}\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Web Start\1.6.0_22\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_CLASSES_ROOT\Installer\Products\4EA42A62D9304AC4784BF238120622FF\SourceList\Net\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_CLASSES_ROOT\Installer\Products\4EA42A62D9304AC4784BF238120622FF\sourceList\Media\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_CLASSES_ROOT\Installer\Products\4EA42A62D9304AC4784BF238120622FF\SourceList\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_CLASSES_ROOT\Installer\Products\4EA42A62D9304AC4784BF238120622FF\"
WshShell.RegDelete strKeyPath

set demofolder = filesys.GetFolder("Program Files\Java\")
demofolder.Delete


end if

if MachineType=64 then
'''''''''''''''x64 runtime
strKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216022FF}\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Web Start\1.6.0_22\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_CLASSES_ROOT\Installer\Products\4EA42A62D9304AC4784BF238120622FF\SourceList\Net\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_CLASSES_ROOT\Installer\Products\4EA42A62D9304AC4784BF238120622FF\sourceList\Media\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_CLASSES_ROOT\Installer\Products\4EA42A62D9304AC4784BF238120622FF\SourceList\"
WshShell.RegDelete strKeyPath

strKeyPath = "HKEY_CLASSES_ROOT\Installer\Products\4EA42A62D9304AC4784BF238120622FF\"
WshShell.RegDelete strKeyPath

set demofolder = filesys.GetFolder("c:\program files (x86)\java")
demofolder.Delete
End if


End Sub

--------------------

Thursday, October 21, 2010

32bit Java install for vista / Win 7

There are 2 flavors of Java a 64bit version and 32bit version. Depending on your machines you may need to install both. We run the 64bit version of Win7 for our enviroment. There seems to be a problem with the installer when installing 32bit version, I don't know the exact cause but the end result is such.

When you deploy the .EXE to the Vista/Win 7 machines the Java install folder is left with a Core.zip file and the error you will recieve will either be "unable to extract Core.zip file" or The Status message may return with a sucessfull install even though it didn't complete. If you go to the Java website it will test your machine and tell you that Java is installed correctly. This is because the registry entries are there but the install didn't complete. If you try to vist a site that requires Java the Browser generally will crash.

How to Fix and Deploy Java

Normal Deployent:

jre-6u22-windows-i586.exe ADDLOCAL=ALL IEXPLORER=1 NETSCAPE=1 MOZILLA=1 JAVAUPDATE=0 /quiet

Modified Deployment:

Start by performing a standard install on a machine. Then depending on which OS you ran it on you can copy the install folder off the machine. The install files are generic so they will work on any OS. You don't need to repeat the install on a different OS.

Vista /Win7

C:\Users\UserNAME\AppData\LocalLow\Sun\Java

XP
C:\Documents and Settings\UserNAME\Application Data\Sun\Java\[java version]

Here you will find the installer folder with the MSI and files necessary to install. You will need the full contents of the folder, not just the MSI. Copy this folder out and use it to install. Then the command line will be MSI based. You can use this for XP also but I found that with XP the .exe installer works fine.

This MSI install should work fine for your Vista or Win7 machines.

Note: I haven't had any problems with the Java 64bit version installer so you can use the .EXE to deploy that version.